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.

Featured Replies

Posted

For a while now I've been making some huge changes when it comes to combat in MC. It's time to apply those onto mobs (till now they are all running on Players only).

 

While with players it's pretty simple: player loads, gets effects (like buffs or e.g burn effect) and in case of logout it can all be saved to HDD (I'm using json - better than NBT, because u can edit it like txt), I can't get around working on implementation of whole system for normal entities.

 

What I need are answers.

Situation: World is created, spawn "manager" spawns entities (mobs), now:

 

* Let's have zombie - after player loads some chunk, then leaves it and chunk is unloaded - what happens to the zombie? I belive it is saved somehow (in world ofc.) BUT:

- The "unique" entityID is for loaded entities only (am i right here?), that means there is no injective situation (one-to-one), so how can I track this zombie being loaded again? (you give this zombie effect, shut down MC, start it back and I want to know which zombie it was).

 

* Is it just my delusion or once the mob is spawned it is sometimes not saved? (or never?)

- I never ever wondered about this until now, but - when mob is spawned, and you leave that "loaded" area and later come back - it isn't there. When the mob is saved and when not? Maybe never?

 

* Following question before, assuming that they are not always saved - if something like that happens (mob spawns, I go back far away, and then come back to location where that mob was) what is the maximum range when the entity is not unloaded? Let's say you back 100 away and come back - it is, but if you go 500 and go back it won't be there.

 

* How is night affecting night mobs - are they all just destroyed? What about data saved for them? It all must be somehow being processed, what are key points in entities lifespan (creation, life, death, saving to HDD, nbt)? Where to find those?

 

Hope I can get as much as possible from you guys, any help regarding entity handling is appreciated, links and stuff.

 

Thanks.

1.7.10 is no longer supported by forge, you are on your own.

Well, you can rather easily do this with NBT, if you aren't opposed to NBT altogether.  Just use Entity.writeEntityToNBT and Entity.readEntityFromNBT, editing the tag in between.

You Only Live Once, So Win At Golf.

Sorry for my English, I'm American.

  • Author

@diesieben07

Always can count on you. Thanks pal.

@JavaMatrix

And yup, I'll use that. No need to use my own mob-effect mapping.

 

I don't think there is anything more here, so let's say it's resolved.

1.7.10 is no longer supported by forge, you are on your own.

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.