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

Team online

Latest profile posts

Eli wrote on Mappoe's profile.
Thank you for the follow!
Reesle wrote on IAmEclipsy's profile.
Thank you for the follow! :) 🐈‍⬛
WorriedSkate940 wrote on ItzJuan's profile.
pro
Just got 2 Notch Apples from 2 Diamond Lucky Blocks consecutively! Wonder what the odds of doing that are lol
IMG_6882.png
Top Bottom