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

  • Author

OK, I now created (a little bit different from what you said) a scheduler which calls every tick every object in the active task list. With a task object you can do anything you want, so I can use it also for other things.

 

But now I have the same problem I mentioned above: I want to save the running tasks. I can save a presistant UUID for an Entity, but I don't know how load a Entity from its UUID. Anyone who knows this?

Are you talking about the player again?

 

You can write some code to save that list to file and then load again, but why.

 

As you cycle through the players, if they meet the criteria, add a value to their NBT data  (player.getEntityData or something like that) for your mod.  If they don't meet the criteria remove the tag and take them off your list.

 

If you really want the first, i can give you an example, but the NBT is the way to go.

Long time Bukkit & Forge Programmer

Happy to try and help

  • Author

Well actually I don't want to do this only for player but for any Entity, but I don't think this changes much.

What I don't understand is how to get the player(or entity) you marked before via NBT. Im thinking about a kind of a waiting loop (via the onEntityJoinWorldEvent) where the task for the player waits until the player comes online and then starts executing again. Is this something like you thought about?

For the player, just check when you cycle through player list if thye have the tag and then add them to the arraylist if they are not there yet.

 

For Entities, what entities?  custom ones or current ones?

Long time Bukkit & Forge Programmer

Happy to try and help

You could do the same NBT data look for entity.

 

Probably only interested in ones that are a certain distance from players.  Rather than keeping a list, might be easier to search for all most within 50 blocks of the player and applying if their NBT data has the tag.

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.