blackyadder
Well-Known Member
Hi guys I try to made a bukkit permissions plugin but I get an error and if I fixed the error I get a new one. Can some one tell me whats wrong? The wholle script is below this
package me.bukkit.blackyadder;
import org.bukkit.Material;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.permissions.Permission;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.plugin.command.Command;
import org.bukkit.inventory.ItemStack;
public class AntiBlock extends JavaPlugin {
public Permission playerPermission = new Permission("playerAbilities");
@Override
public void onEnable() {
new BlockListener(this);
PluginManager pm = getServer().getPluginManager();
pm.addPermission(playerPermission);
}
@Override
public void onDisable() {
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (cmd.getname().equalsIgnoreCase("givemeitems") && sender instanceof Player) {
Player player = (Player) sender;
if(player.hasPermission("playerAbilities.allowed")) {
player.setItemInHand(new ItemStack(Material.DIAMOND_AXE));
return true;
}
}
return false;
}
}
}
package me.bukkit.blackyadder;
import org.bukkit.Material;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.permissions.Permission;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.plugin.command.Command;
import org.bukkit.inventory.ItemStack;
public class AntiBlock extends JavaPlugin {
public Permission playerPermission = new Permission("playerAbilities");
@Override
public void onEnable() {
new BlockListener(this);
PluginManager pm = getServer().getPluginManager();
pm.addPermission(playerPermission);
}
@Override
public void onDisable() {
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (cmd.getname().equalsIgnoreCase("givemeitems") && sender instanceof Player) {
Player player = (Player) sender;
if(player.hasPermission("playerAbilities.allowed")) {
player.setItemInHand(new ItemStack(Material.DIAMOND_AXE));
return true;
}
}
return false;
}
}
}