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

Currently, the way to implement a custom spawner is to tick a custom spawning class via WorldTickEvent on the logical server. Minecraft has 5 spawners that are marked as 'special' meaning they extend ISpecialSpawner. These are first passed into an immutable list within MinecraftServer::func_240787_a_ and then stored as a variable within server world to be called when a chunk is ticked.

 

I suggest a new hook that takes in a list of these 5 existing spawners along with a parameter for IServerWorldInfo. This could then be past into a new event which allows the user to add a spawner. As an option, a user might also be able to remove the other 'special' spawners as well to replace with their own. Afterwards, the hook would return an immutable list containing the special spawners. The event should not be cancelable and should not have a result. It would also be fired on the MinecraftForge::EVENT_BUS. This hook would only be called once during the initialization of the logical server as opposed to being called every tick as an alternative.

 

If this seems like a valid event to be implemented, I will get started on creating a PR for 1.16.

  • Author
7 hours ago, diesieben07 said:

I am not sure what purpose this event would serve over using WorldTickEvent. The spawners are just called every world tick, unless doMobSpawning is set to false, which is trivial to check. I don't think a new event is needed here.

Ok, just wanted to make sure.

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.