#I can't get armor slots from an entity

32 messages · Page 1 of 1 (latest)

heavy kelpBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

violet flower
#

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

muted tartan
#

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

next silo
#

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

muted tartan
next silo
#

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

muted tartan
#

How can I get entity nbt inside a script? For some reason entity.getNbt() does not work

next silo
#

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

violet flower
#

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!

next silo
#

Looks like you may have to wipe "ArmorItems" from nbt, I can't see it fully

brittle charm
#

theres a yt tutorial on this where it shows how to equip armor at the end of the 2nd video

half orchidBOT
#

📼 Youtube Tutorials 📼

brittle charm
#

10:42 in

next silo
#

that isn't going to work unfortunately cause it's not item slotted armor

#

that mod does something different.

brittle charm
#

it looks like it places the armor in the vanilla armor slots though

#

according to the nbt anyways

next silo
#

not sure, can’t see full nbt data, though getArmorSlots isn’t return nothing but air 😅

brittle charm
#

yeah thats the weird part

brittle charm
# violet flower Hi, Thanks for your help. I wrote a script that I think checks which armor a mob...

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:[]}`) } })