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

Latest profile posts

Heya, after a good while years having not appreciated sleep a lot, have I learned things. I have most of the times seen it as a hindrance to things such as relations and projects. But after years I realised that you need to sleep to be well. Both physically and mentally. When I also realized that I could work better and more efficiently, did I try to get more sleep. That reminds me, I need to sleep now hah XD
Eli wrote on marshduck11's profile.
I like your profile picture
Mr Jii Gamer wrote on Egg🥚's profile.
Thank you so mush for everything

I know i am late bc i didn't realize that you have left the team sadly we see the better one go ..
Will be announcing the giveaway winner within the next 2 hours or so.
Reesle wrote on Cloudiefly's profile.
Happy Birthday! 🎂 ☁️
Top Bottom