#I can't get armor slots from an entity
32 messages · Page 1 of 1 (latest)
Ticket re-opened!
I cant get armor slots from an entity
Hello, I'm writing a script that will check if a zombie is wearing specific armor from the Marbled's Arsenal mod. However, I used getArmorSlots, and it only retrieves vanilla armor and backpacks if the zombie is wearing one. It won't return armor from the Marbled's Arsenal mod. I did use the /probejs dump feature, but still nothing. I want to disable this armor from spawning on entities. Thanks in advace!
I can't get armor slots from an entity
I'm also looking for a solution, I need to make sure that the entity is fully equipped with armor from Mekanism, but I can't even figure out how I can get the armor id in the armor slots
have you tried data commands?
like um
/data get entity @e[type=zombie,distance=..10,limit=1]
see how the armor is stored. (i can’t recall exactly), but it should be nbt
just don’t recall the entry in the nbt it’s located
oh hey another TLauncher user 😶
you know it’s much safer actually buying the game than risk malware
How will this help me? Can I receive data inside a script through commands in Minecraft?
this would help you debug in seeing or modifying the nbt of an entity in-game how they’re wearing armor.
far as the script goes, however you’re going to apply armor to entities, it would be done so by their nbt
i guess if wanted you can debug it all through a script as well, whichever way may be easier for you
How can I get entity nbt inside a script? For some reason entity.getNbt() does not work
in your case, you can use entity.setItemSlot
OP would actually need to use nbt
edit: i would have to look at mod source to be sure
Hi,
Thanks for your help. I wrote a script that I think checks which armor a mob is wearing, but I can only retrieve vanilla armor and not other types. The purpose of the final script is to prevent mobs from spawning with Black Juggernaut armor because it crashes the game.
When I run the /data get entity @e[type=zombie,distance=..2,limit=1] command, it shows the correct armor. However, it seems that KubeJS only registers vanilla armor. Am I doing something wrong?
Thanks in advance!
Looks like you may have to wipe "ArmorItems" from nbt, I can't see it fully
theres a yt tutorial on this where it shows how to equip armor at the end of the 2nd video
📼 Youtube Tutorials 📼
10:42 in
that isn't going to work unfortunately cause it's not item slotted armor
that mod does something different.

it looks like it places the armor in the vanilla armor slots though
according to the nbt anyways
not sure, can’t see full nbt data, though getArmorSlots isn’t return nothing but air 😅
yeah thats the weird part
try this js EntityEvents.spawned(event => { if (event.entity.type.toString() == 'minecraft:zombie') { event.entity.setItemSlot("head", "minecraft:diamond_helmet") event.entity.setItemSlot("chest", "minecraft:diamond_chestplate") event.entity.setItemSlot("legs", "minecraft:diamond_leggings") event.entity.setItemSlot("feet", "minecraft:diamond_boots") } })
and if that one doesnt work then try this onejs EntityEvents.spawned(event => { if (event.entity.type.toString() == 'minecraft:zombie') { event.entity.mergeNbt(`{ArmorItems:[]}`) } })