Jump to content

Some general questions about mob DataManagers


hjk321

Recommended Posts

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.