Block damage

Discussion in 'Plugin Development' started by wydgabriel, May 9, 2016.

Thread Status:
Not open for further replies.
  1. Offline

    wydgabriel

    Hi guys.
    I'm trying to make a system that the player (in adventure mode) can ''break'' the block but the adventure mode dont let it.
    Well, its good so far. But, I want to the ore changes to stone after its damaged enough to be broken.
    The block break event is not called because they are in adventure mode. Some suggestions? Thanks :D
     
  2. What's the point of them being in adventure mode then? :p
     
  3. Offline

    wydgabriel

    Because I dont want to let them to break another blocks bro. I just want to let them break coal ore, then after it breaks, it turns into stone. :)
     
  4. Offline

    Zombie_Striker

    @wydgabriel
    Adventure mode cancels the client from even attempting to break blocks. You would need to change them to survival if you want them to break blocks.

    BTW; The only thing that is different between survival m,ode and adventure mode IS the ability to break blocks.
     
  5. Offline

    wydgabriel

    But there is no event called before the block break?
    Like a damage block event, idk
    Saw some post saying to get block data, but I dont know how it works.
    I dont want to get the block broken, I just want the exact time before it breaks, a pre break event :/
     
  6. Offline

    Zombie_Striker

    @wydgabriel
    The event to check if the block is broken is handled client side if the player's mode is Adventure as the main goal of adventure mode is so they cannot break blocks. Just set the player's game mode to survival if you want them to break blocks.
     
  7. Offline

    wydgabriel

    Jesus Christ bro, I dont want them to break the block. I want to change the block ID before it gets too damaged.
     
  8. Offline

    MadMaxCookie

    @wydgabriel it seems fine if you want it to be made in Gamemode survival or creative
     
  9. Offline

    Zombie_Striker

    @wydgabriel
    Sorry, skipped over that last line in your post.

    Although this event may not be triggered for all cases, PlayerInteractEvent will detect when a player interacts with anything (right or left click). I say may because adventure mode cancels certain events in specific cases, so this event may not always get triggered when a player clicks a block.
     
  10. Offline

    Ironraptor3

    He's saying that this may not be possible in adventure mode, and that you should simply check when a player is interacting with a block in survival mode, cancel the event, and check for the specific instance.
     
Thread Status:
Not open for further replies.

Share This Page