Solved Need Help with plugin

Discussion in 'Plugin Development' started by linkrock4, Apr 16, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    linkrock4

    Hello im just trying to make a simple plugin where you do /ID and it tells you the ID of the item in your hand. Im just testing this out to see if this works

    Code:
    package com.legendarybane;
     
    import org.bukkit.Bukkit;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.plugin.java.JavaPlugin;
     
    public class LbID extends JavaPlugin {
       
        public void onEnable(){
            getLogger().info("LbID has been Enabled.");
        }
       
        public void onDisable() {
                getLogger().info("LbID has been Disabled.");
            }
       
        public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){
                if(cmd.getName().equalsIgnoreCase("ID")){
                    Bukkit.broadcastMessage("Test");   
                    return true;
                }
                return false;
    }
    }
    
    And it does... But i dont know what to do now, i know i have to use e.getItemHand() but i cant get it to work. Anyone knows how?

    Thanks :)
     
  2. Offline

    microgeek

    player.getItemInHand().getTypeID()?
     
  3. Offline

    crushh87

    int id = p.getItemInHand().getTypeId();
    p.sendMessage("The item Id of the Item you are holding is " + id);
     
Thread Status:
Not open for further replies.

Share This Page