Hello, I am currently overhauling some vanilla mobs to have a third state between sitting and following. I am accomplishing this by reading a simple boolean NBT tag and altering the mob's AI on EntityJoinWorld. I just have a few general questions that would really help me out if someone could take the time to clear some things up for me.
This is how these DataParameters are defined for reference, by the way.
public static final DataParameter<Boolean> WOLF_INDY = EntityDataManager.createKey(EntityWolf.class, DataSerializers.BOOLEAN);
public static final DataParameter<Boolean> OCELOT_INDY = EntityDataManager.createKey(EntityOcelot.class, DataSerializers.BOOLEAN);
public static final DataParameter<Boolean> PARROT_INDY = EntityDataManager.createKey(EntityParrot.class, DataSerializers.BOOLEAN);
1. Is it a good idea to have a mod add DataParameters to vanilla mobs? I could see that perhaps this would create incompatibilities somewhere.
2. How would these new DataParameters be handled by existing worlds? Would it default to false or throw errors?
3. Am I missing something obvious about handling custom mob NBT? This whole DataManager thing seems kinda convoluted for a simple key:value system. I could understand the value of enum-style tag definitions if you were, say, making your own mob, but I'm modding the AI of vanilla mobs on the fly, and the boolean I'm defining will only apply to certain instances of said mob anyway. Why can't I just define a custom tag via a string like you can using an in-game command? like literally all I want to do is add {Indy:true} to certain mobs and then read that later.
Thank you for your advice.