Traben-0 / Entity_Model_Features

Other
104 stars 18 forks source link

[Idea] Nbt.Inventory issue and my idea to fix it #272

Open PixalThePixeled opened 2 months ago

PixalThePixeled commented 2 months ago

While creating a resource pack, I wanted to add custom armor to it and ran into a problem - mobs have 'ArmorItems' and 'HandItems' tags and it is very easy to determine the armor worn by mobs since each item is tied to a specific object in array, and these objects can be empty (ArmorItems.0 - boots, 1 - leggings, 2 - chestplate, 3 - helmet): nbt(ArmorItems.3.id, raw:minecraft:leather_helmet) && nbt(ArmorItems.3.tag.display.Name, raw:\"Bandana\")

But the players doesn't have this option due to the fact that they uses the 'Inventory' tag in which new objects are added to array as slots are occupied.

Subsequently, I had an idea - in the game the 'data' command allows you to define an object containing a certain key, for example - an object with the key 'Slot:103b' (head slot):

/data get entity @s Inventory[{Slot:103b}]

image

This leads to my idea - being able to define an object in a list using a similar method, it might look like this:

nbt.1.Inventory{Slot:103b}.id=raw:minecraft:leather_helmet

and same for nbt in emf cem animation: nbt(Inventory{Slot:103b}.id, raw:minecraft:leather_helmet)

This will be useful for defining different tags of an item in a certain slot, such as its name.