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
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.
@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.
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 :/
@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.
Jesus Christ bro, I dont want them to break the block. I want to change the block ID before it gets too damaged.
@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.
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.