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

Members online

Latest profile posts

This is YOUR daily dose of facts #41-
The moon has moonquakes, which are kind of like the earthquakes on the Earth, but weaker.
Basketman wrote on Eli's profile.
Favourite how to tame a dragon movie, shoot.
Reesle wrote on ii6xxq's profile.
Welcome to the Official Cubecraft Forums!! Hope you enjoy your stay :)
Reesle wrote on Lucaatjee's profile.
Happy Birthday! 🎈
Matriox wrote on Kloska's profile.
day x
Top Bottom