Plugin not working. getTypedID() Change?

Discussion in 'Plugin Development' started by moodoggy, Dec 13, 2013.

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

    moodoggy

    HTML:
    @EventHandler
        public void onInvClick(InventoryCloseEvent event) {
            Player player = (Player) event.getPlayer();
            PlayerInventory pi = player.getInventory();
            if (pi.getHelmet() != null && pi.getChestplate() != null && pi.getLeggings() != null && pi.getBoots() != null) {
                int h = pi.getHelmet().getTypeId();
                int c = pi.getChestplate().getTypeId();
                int l = pi.getLeggings().getTypeId();
                int b = pi.getBoots().getTypeId();
           
                if (h == 306 && c == 307 && l == 308 && b == 309) {
                    if (pclass.get(player.getName()) == "Warrior")  {
                        return;
                    } else {
                        pclass.put(player.getName(), "Warrior");
    I want the player to become a Warrior when they equip full Iron. My plugin has worked before and I just came back to it. However now nothing happens when full iron is equipped. The getTypeID() is getting suppressWarning's

    Appreciate the help :D
     
  2. Offline

    thomas15v

    Use GetType and check on the material enum.

    For example
    Code:java
    1. Material h = pi.getHelmet().getType();
    2. if (h == Material.IRON_HELMET){
    3. //do code
    4. }
     
Thread Status:
Not open for further replies.

Share This Page