In Control!

In Control!

72M Downloads

EntityLiving.readEntityFromNBT Strips useful tags

thePalindrome opened this issue ยท 6 comments

commented

In regards to a lot of the problems people have with NBT tags, turns out the problem is that EntityLiving.readEntityFromNBT (which is what mcjtytools uses for the mobnbt) doesn't actually dump the nbt into its own data, it instead just cherrypicks specific tags (that's why Attributes works, but not CustomName).

What would probably work better (despite being rather silly) would be to use EntityList.createEntityFromNBT using the desired NBT tags and the world from the entityliving obtained from the event (that being the function that /summon uses)

This would be very nice to have for certain cases, so hopefully this can be resolved soon.

commented

I'll try to check it out soon

commented

createEntityFromNBT is really very heavy for this and also will not work right given that we don't supply a complete NBT. So not sure how to solve this properly except by manually handling all the tags that are not supported by readEntityFromNBT. I'll check it out

commented

I'll just add a separate customname action. Are there any other things in this NBT data that would have to be supported?

commented

https://minecraft.gamepedia.com/Entity#Entity_format contains a list of tags entities should have, and is imo the main things we'd need to be working with.

(I'd complain about how the entity function is stripping entity nbt, but it's mojang, I'm not surprised)

commented

Well I'm not going to implement all of those. Just the ones that people actually need

commented

Alright, I'll poke around, see what the teams I'm on would want, but custom name (and also customNameVisible) for sure