Can someone please help me create a spawn protection like McPvP. I would like for it to be so that when a player walks over a block (GlowStone) they lose spawn protection. In spawn I want it so that you can't take any damage.
If you want to download one, check out jProtection on bukkit.org And if you want to create it yourself it is about 1 hour of work if you know all the code. I made one myself took me about 2 hours since I was still a noob lool..
ajs333 Anyway this is what you have to do: Make a main class where you register all events with a variable Make a listener class with an arraylist of players who have spawn protection If a player is in the arraylist then have invincibility If a player retypes /spawn or whatever they gain spawn protection Make a config to store the location of spawn Then add the loose spawn protection messages or whatever you would want. Implementing worldguard would be pretty hard but that might only be for me since ive never done nothing with worldguard or worledit
ajs333 Basically what you need to check for is the various block place & destroy and player & entity damage events and then cancel them
ajs333 Use the PlayerMoveEvent and get the player's location. Then check the block directly below the player using Code:java Location loc = event.getPlayer().getLocation(); and then Code:java if (loc.getBlockX().getType().equals(something)){//do some stuff}
PHP: Block b = p.getLocation().getBlock(); Block b1 = b.getRelative(BlockFace.DOWN);if (b1.getType() == Material.GLOWSTONE) {make your stuff