Using Techne models as Hats?

2 posts / 0 new
Last post
Offline
Last seen: 1 year 3 months ago
Joined: 07/07/2015 - 00:40
Gems: 0
Using Techne models as Hats?

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?



Offline
Last seen: 1 year 3 months ago
Joined: 07/07/2015 - 00:40
Gems: 0
I tried adding this to my

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);
}