#'getEquipment' of undefined

1 messages · Page 1 of 1 (latest)

steep jungle
#

why this work only in the player?

        const pEquipment = player.getComponent("equippable").getEquipment("Mainhand")
        const eEquipment = entity.getComponent("equippable").getEquipment("Mainhand")

i want to copy the player equipment to the entity but this i can't seam to figure out how to get the other entity equipment

polar remnant
#

perhaps because there is air in this slot?

steep jungle
#

getComponent("equippable") return undefined
dk why

polar remnant
#

it returns undefined if the slot is empty

steep jungle
#

: /
getComponent doesn't return a slot or item

polar remnant
#

So I didn't understand correctly 😦

narrow cove
polar remnant
#

minecraft:equippable

narrow cove
steep jungle
#

should i just add "minecraft:equippable":{}, to the entity?

steep jungle
#

ok
thanks

#

same problem

inland sedge
steep jungle
inland sedge
inland sedge
#

hmm, will check in a bit and let you know

steep jungle
#

ok thanks
i need a break xd

steep jungle
#

i think i am just going to get the item id and use commands

inland sedge
steep jungle
#

also thanks for you time

dawn flint
#

@steep jungle

They temporarily disabled this component for entities other than players. They have every intention of bringing this back but for now we can only use it for players until further notice. I think it was in 1.20.20 when they made this temporary change.

#

They also mentioned it in the release notes too.

mossy saffron
#

man it’s currently 1.20.80 and its still disabled

blissful magnet
#

Oh I am late to this

#

Sorry