Jump to content

Recommended Posts

Posted

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.

 

 

public void tame(EntityPlayer player)
    {
    	
         tamerName=player.username;
         sitting = true;
         motionX = 0;
         motionY = 0;
         motionZ = 0;
         tamed = true;
         exp = 0;
         atHome = false;
         hostile = false;
         rival = null;
         health = getMaxHealth();

        \    }

 

 

 

Here is my tame code that I have put up in so many other posts :P These are the things that need saving, and 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: Will 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!

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.