Jump to content

[1.7.2]Do I have to register entities that are transitory and invisible?


Recommended Posts

Posted

I'm using an IThrowable entity to allow for a ranged effect.  Basically when I use an item it shoots out this entity and then does something when it hits a block.

 

I noticed that it works even if I don't register the throwable entity to the game registry.

 

I was wondering what harm, if any, it would do to not register it.  It seems to me that registration is mostly to aid keeping track of the entity -- it presumably allows saving/loading and also client-server sync.  But since I'm using this entity to almost instantaneously create an effect on the server side only, do I really need to register it?  I don't need to save it (i.e. quitting game while this was "in the air" doesn't really need to save), and I don't need it on client side (effect will occur on client based on effect invoked on server).

 

Should I just register it anyway?  I just like to make sure I fully understand things, and this prompted some thinking about the registry.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Posted

That is a very good question.

 

I dug into the entity register at one point for other reasons and the bulk of the code was to do with syncing it up with the client.  However, I am a bit suprised it works without registerying.  I wouldn't think it would update the entity for movement to occure.

 

I'm not curious too.  If it moved outside of a loaded are, i imagine it will just go poof.  Have you tested this away from spawn to see if it still does what you want?

 

 

Anyhow, i'm with your last statement.  I'd register it just in case.

Long time Bukkit & Forge Programmer

Happy to try and help

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.