Want a better Minecraft server? Read about SpigotMC here!
Separate names with a comma.
Discussion in 'Spigot Plugin Development' started by Aruzo69, Apr 1, 2020.
how can i change limit radius where player can place block? From 3 to 5
Check the player's location and check the distance between the placed block and the player's location if it's greater than 5 cancel it.
You can call the BlockPlaceEvent, there you can get the Player which placed the block. After that you get the players location and the location of the placed block. Then you would need to do a bit of maths and check if the block is more then 3 blocks away. Then you can cancel the event so the Block wont be placed.
I mean player can place block 15 blocks away from him
I'm not sure I understand? What are you trying to do? I don't think it's possible for players to just place a block 15 blocks away lol