How to cancel block break but not with BlockBreakEvent, for example, if you have some sword in hand, you can't break anything. What is the code for this?
you must use blockBreakEvent and check the item in the player hand if is a sword then cancel the event
Cancel PlayerInteractEvent (Guess), or set player's gamemode to adventure (2 or 3, I think) [100%]. Remember, they can't pvp in adventure.
I think the player not being able to break any block with a sword in hand is done client side? Not sure abt this..
For example, when you joined the arena in the skywars on the lifeboat server, you can't destroy the glass around you, the blocks are destroyed to some 90% and then renewed
For cancelling block break event you simply do this (PS. YOU MUST USE BLOCK BREAK EVENT ) PHP: $event->setCancelled();