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 long time I've had this idea for what I assumed would be a very basic starter mod, but one I hadn't seen anyone create. Once I got Eclipse set up and started digging, I found out it may be harder than I thought. However, I still think it will be a worthwhile mod to pursue. I have more experience in Python, but I'm able to read and muddle through in Java.

 

I'm looking for a way to create an interaction between any spawner and a vanilla hopper without creating a full-fledged replacement for either. Ideally, it would work on modded spawners too. If someone could point me in the right direction, I'd really appreciate it.

 

The trouble I'm running into is that neither has a Forge event that I can find. diesieben07 wrote a pull request for adding a 'MobSpawnerSpawn' event, but it was rejected. If I were editing Minecraft core, I'd just modify the tick() methods. If it were Python, I'd just replace the 'tick' method with my own code at runtime.

 

I'm going to dig in to see if there is a place I can inject a simple replacement class, but I'm not optimistic. I may need to take a step back and look at an easier starting place for my modding debut.

EDIT: I'm thinking it might be possible to tweak net.minecraft.world.spawner.AbstractSpawner to suit and then replace spawnerLogic in net.minecraft.tileentity.MobSpawnerTileEntity? I'm not sure how that is instantiated yet.

 

Edited by Grinneg

That commit is over 6 years old, so I will have to ask what version is this for.

4 minutes ago, Grinneg said:

spawner and a vanilla hopper

Also, this makes little sense to me. Are you trying to stop a mob from spawning, grab it's drops, and immediately push to a hopper? If so, there is an event for that in latest called LivingSpawnEvent#CheckSpawn which has a result that you can prevent it from.

  • Author

I guess I'm not as sneaky as I thought. XD I've searched everywhere to try to answer my questions before asking - so I'm not surprised that's ancient. I'm currently working with 1.16

 

My general idea was to allow 'mob grinding' without spawning the mob entities. Most of the modded servers I've played on are heavily impacted by mob spawning machines of all sorts, and I thought it would be worthwhile to create an interaction where a hopper below the spawner would just output drops until the hopper gets full and then stop.

 

It looks like LivingSpawnEvent is the right place to look. Thanks! I need to figure out what I'm looking at there.

 

 

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.