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
24
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
24
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
24
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

Latest profile posts

Reesle wrote on ZachTart26's profile.
Welcome to the Official Cubecraft Forums! If you need help with something, feel free to DM me or a staff member anytime! Have a great day! :D
Reesle wrote on CalvinxKlein's profile.
Happy Birthday! 🎂
Watching the sun set... 🌅

1732368294873.png
Hello Guys i had been playing cubecraft for 1 year and 2 months and i got pretty good at it. i am good at games like CTF And Bridges
Top Bottom