Using Techne models as Hats?

Started by dragon_12dk on Thu, 07/09/2015 - 23:51
Last seen on 21:52, 4. Feb 2018
Joined Jul 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Using Techne models as Hats?
Thu, 07/09/2015 - 23:51

Hello, recently i have made several upon serveral hats in techne, but i cant figue out how to get the techne model (hat) on top of your head... What custom code would you recomend?

Last seen on 21:52, 4. Feb 2018
Joined Jul 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
I tried adding this to my
Fri, 07/10/2015 - 05:12

I tried adding this to my event ->

But i crashed :(

 

if (player.getItemInHand().getType() != Material.AIR) {
    ItemStack itemHand = player.getItemInHand();
    PlayerInventory inventory = player.getInventory();
    ItemStack itemHead = inventory.getHelmet();
    inventory.removeItem(itemHand);
    inventory.setHelmet(itemHand);
    inventory.setItemInHand(itemHead);
}