#merge entity nbt

6 messages · Page 1 of 1 (latest)

ionic adder
#

I've searched all posts but no resolution was found. Is there any way a custom nbt value can be added to a entity? And I'm also wondering the diffrenece between mergeNbt and nbt.merge and when each method should be used.
This is my current tests.

ItemEvents.entityInteracted(event => {
    const { target } = event
    target.nbt.merge({"test": "test"}) // custom tag, can't merge
    target.nbt.merge({noGravity:true}) // vanilla tag, can't merge
    target.mergeNbt({"test": "test"}) // custom tag, can't merge
    target.mergeNbt({noGravity:true}) // vanilla tag, able to merge
})

I found it's also not available to edit a cutsom nbt through vanilla commands. Does it mean there's no way for adding a custom nbt using kjs?

pastel yachtBOT
#

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

pliant shoal
#

Typically you want to use mergeNbt, that will actually update entity

#

entity.nbt is a copy of entity nbt every time its called, modifying it wont do anything

ionic adder
#

Yeah that quite explains a lot. So the merged custom tags will lose through updates. That's the reason custom tags are not available right? I've understood. Thanks for ur help! I think mergeNbt should works for modded mobs then if it works in this way.