Started by
MamaLuigi
on
Topic category: Help with Minecraft modding (Java Edition)
I have an entity variable, and I want to set a player persistent, string/number variable, (whichever is better), to it, but I can't figure out how to.
Is it even possible? If so, how do I do it? If not, what can I do instead?
Any help would be greatly appreciated!
Unfourtunately, I haven't been able to find a good way of saving entity data as global variables. (Though it's presumably possible, as I'm pretty sure this is how taming works.) What specifically are you trying to do? There might be a simpler workaround.
I figured out that bit, and i have stored the entity as a global string variable, but how can i set a local entity variable to a string variable?
That's the trouble, I'm pretty sure MCreator doesn't allow saving entities as global variables, only local ones.
One thing you could try is getting the registry name of the entity, and saving it as a string variable. (Though this, of course, wouldn't save NBT data or unique properties.) But you would then at least be able to use it in commands, (by using text functions to insert the entity's registry into the code for a summon command, data command, etc.) Otherwise I'm not 100% sure.