Magic

Magic

190k Downloads

Allowed/Disallowed armour slots for magic items? (feature request)

NightScythe1 opened this issue ยท 8 comments

commented

Perhaps add the possibility for certain magic items like armour to be allowed, or disallowed to be placed in armour slots. E.G. allowing a Magic Hat to be placed on the head without having to cast a spell, or disallowing an armour item to be placed in it's corresponding slot (i.e. a chestplate not allowed in the chestplate slot) so that they can be used for other kinds of magic items and not accidentally equipped.

commented

I have implemented half of this, you can now make hats that can be worn like a normal helmet.

However I don't fully understand the idea of wanting unwearable armor. Why would you need that? Could you just use some other item instead?

commented

I've tried that actually but sadly they don't take durability when worn so they don't function as intended :( only armour items take durability in those slot

commented

Ah... ok .. well that's a really interesting idea. I'll see if I can make it work!

commented

Thanks so much! Great work on the plugin as always! :D

commented

I think this should be ready for you to test in the latest dev build. Here is a use example:

hardhat:
  name: Hard Hat
  icon: diamond_chestplate{CustomModelData:1}
  stack: true
  passive: true
  wearable:
    - helmet
  attributes:
    constitution: 2

The important bit being the wearable list, where you put the slots it's meant to go in. This was actually not a new feature, but I changed it so that list also prevents wearing in any slots other than that list, even if vanilla would say otherwise.

Seems to work OK, but I did run into a nasty issue (that I think I fixed) where it hit that dreaded TRAP assertion for 0-count items when right-clicking to wear it. I also had some difficulty with the InventoryDragEvent, my least favorite of all inventory actions, but I'm hoping I got that handled as well.

So let me know if you see any weird issues.

commented

Thanks for the implement! And the reason i was asking was so that custom helmets can be made that actually take durability. I.E. my idea was using customModelData to create a custom helmet model, apply it to something like a chestplate or leggings item, and then that will display when it's put onto the player's head since custom helmets on helmet items aren't possible. And i wanted the slot disallow option so that players can't put these custom helmets in the slot of the actual item it is, so if a helmet was made with a chestplate item they wouldn't accidentally equip it to their chest. Hope that clears up what i meant, thanks for trying to implement it though!

commented

Oh ok- well I think you can just use a hoe or whatever non-armor item for that, like how the builtin hats work.

commented

Just checked it out, it works great so far, thanks! I'll let you know if i run into anything.