Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

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

Featured Replies

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/

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.