Solved Hat a block

Discussion in 'Plugin Development' started by 4thegame3, Oct 26, 2014.

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

    4thegame3

    Anyone knows how to do that?
     
  2. Offline

    CraftCreeper6

  3. Offline

    sebcio98

    It looks pretty simple.
    Code:java
    1. ItemStack[] armor = p.getInventory().getArmorContents();
    2. armor[3] = new ItemStack(Material.STEP);
    3. p.getInventory().setArmorContents(armor);

    Don't forget the imports
    Code:java
    1. import org.bukkit.Material;
    2. import org.bukkit.inventory.ItemStack;


    @EDIT
    Code tested. Works fine.
     
    4thegame3 likes this.
  4. Offline

    4thegame3

Thread Status:
Not open for further replies.

Share This Page