Minecraft PC IP: play.cubecraft.net

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;
}

}
}
 

Dan:

Well-Known Member
Aug 20, 2015
334
223
118
23
California, USA
danbeneventano.me
An error would help. But here's what I notice:
  • You never close onDisable (and it's not needed because you're not doing anything in there).
  • You need to implement CommandExecutor
  • You need to set the executor of the command
  • getname should be getName
  • You need to register BlockListener
  • You need to have the permission
 

blackyadder

Well-Known Member
An error would help. But here's what I notice:
  • You never close onDisable (and it's not needed because you're not doing anything in there).
  • You need to implement CommandExecutor
  • You need to set the executor of the command
  • getname should be getName
  • You need to register BlockListener
  • You need to have the permission
Okay I'll try to fix it. thx..
 

Icegroose

Well-Known Member
Nov 25, 2015
4
0
76
23
I use Eclipse Mars but when I fix it I get new errors
As far as I understand the problem it seems like these are errors in the IDE, right? if so can you post a screenshot of the IDE. that will make the troubleshooting process a lot easier for us.
 

Icegroose

Well-Known Member
Nov 25, 2015
4
0
76
23
Eclipse mars is your IDE, so can you post a screenshot of the IDE while the file with errors is open. Then we can see where the errors are (the red lines)
 
Members Online

Team online

Latest profile posts

8 years on the forums!
Otherworld wrote on RobinDn's profile.
Thank you for the follow!
UncleSpect wrote on GiGaGekkies's profile.
You are amazing <3
GiGaGekkies wrote on Ferrcho's profile.
Ola! Happy Birthday! :)
GiGaGekkies wrote on Roxlad's profile.
Happy Birthday <3
Top Bottom