So, after a few more attempts at using datawatchers, I finally figured out I was doing them wrong. So after doing some searching and reading through some other posts, I have come to somewhat understand datawatchers. There are three main portions to using a datawatcher:
addObject, which establishes want you are wanting watched obviously.
getWatchableObject, that instructs it as to where to start watching.
updateObject, which updates what is being watched.
Now is where my flood of questions come in.
The first question goes back to the addObject.
dataWatcher.addObject(2, "");
The 2,"" would be the int and the object, correct? I was told that Minecraft already uses 0,1,and 8. So if this is true, all other ints from 2 to 31 should be usable for anything I need watched, correct?
Also, is it possible for booleans to be watched?
Bonus points: In case anyone is feeling extremely helpful.
Here is my tame code. These are the things that change upon being tamed, and thus need saving, annnnnnd therefore need datawatchers.
These stats are only used once the entity is tamed though. So should I be sticking the updateObject into the tame function?
Last question for now: Would I be needing a separate datawatcher for each of these? I would assume so, but figured I would ask if there is a way to have one datawatcher be watching all of them at once.
addObject, which establishes want you are wanting watched obviously.
getWatchableObject, that instructs it as to where to start watching.
updateObject, which updates what is being watched.
Now is where my flood of questions come in.
The first question goes back to the addObject.
dataWatcher.addObject(2, "");
The 2,"" would be the int and the object, correct? I was told that Minecraft already uses 0,1,and 8. So if this is true, all other ints from 2 to 31 should be usable for anything I need watched, correct?
Also, is it possible for booleans to be watched?
Bonus points: In case anyone is feeling extremely helpful.
Here is my tame code. These are the things that change upon being tamed, and thus need saving, annnnnnd therefore need datawatchers.
These stats are only used once the entity is tamed though. So should I be sticking the updateObject into the tame function?
Last question for now: Would I be needing a separate datawatcher for each of these? I would assume so, but figured I would ask if there is a way to have one datawatcher be watching all of them at once.
Thanks for any help you may be able to provide!