Permission help
Posted: Sat Mar 31, 2012 3:03 am
I'm making a plugin for my server that prevents the placing of certain blocks, but I'm getting an error as I'm trying to add permissions to it and I'm new to Java and don't know what to do, I get this error:
"player cannot be resolved"
I have put a " *** " around the player instance it is saying gives the error here is code:
"player cannot be resolved"
I have put a " *** " around the player instance it is saying gives the error here is code:
package me.killzyazmadness.BlockPrevention; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.block.BlockPlaceEvent; public class BlockPreventionBedrockListener implements Listener { @EventHandler(priority = EventPriority.HIGH) public void onBlockPlace(BlockPlaceEvent event){ if (event.isCancelled())return; if(***player***.hasPermission("blockprevention.place")) { if (event.getBlock().getType() == Material.BEDROCK){ event.setCancelled(false); } }else{ if (event.getBlock().getType() == Material.BEDROCK){ event.setCancelled(true); } Player player = event.getPlayer(); player.sendMessage(ChatColor.RED + "Bedrock is not allowed!"); for (Player onlinePlayer : Bukkit.getServer().getOnlinePlayers()){ if (onlinePlayer.equals(player) == false){ onlinePlayer.sendMessage(ChatColor.RED + player.getName() + "just tried placing Bedrock!"); } } } } }Anyone know what to do to fix this?