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

What would be the best way to change vanilla spawners? i want them to ignore the distance between it and a player if powered by redstone.

Probably making your own version of it and overriding the vanilla one with it (use same registry name)

My Projects:

Cruelars Triforcemod (1.12 release; 1.14 alpha soon coming)

 

Important:

As my mod is on at least 10 different third party sites without my permission, I want to warn you about that with a link to StopModReposts

1 minute ago, DarkAssassin said:

What would be the best way to change vanilla spawners? i want them to ignore the distance between it and a player if powered by redstone.

Override the Blocks.SPAWNER block in the registry with your own. Note you cannot change the BlockState of the Block. Then create your own version of the MobSpawnerTileEntity which does everything the vanilla one does except insert your feature into it.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

  • Author
3 hours ago, Animefan8888 said:

Override the Blocks.SPAWNER block in the registry with your own. Note you cannot change the BlockState of the Block. Then create your own version of the MobSpawnerTileEntity which does everything the vanilla one does except insert your feature into it.

i copied the vanilla spawner classes and added another condition for it to be active but in the copy of the code it gives an error and says :

 

Quote

 The method canEntitySpawnSpawner(net.minecraft.entity.MobEntity, net.minecraft.world.World, float, float, float, net.minecraft.world.spawner.AbstractSpawner) in the type ForgeEventFactory is not applicable for the arguments (net.minecraft.entity.MobEntity, net.minecraft.world.World, float, float, float, me.spawntweak.lists.AbstractSpawner)

but there is nothing that should be missing

 

the line of code is

 

if (!net.minecraftforge.event.ForgeEventFactory.canEntitySpawnSpawner(mobentity, world, (float)entity.posX, (float)entity.posY, (float)entity.posZ, this)) {
                        continue;
                     }

 

 

 

nevermind i just need to copy and edit parts of the event factory, too.

Edited by DarkAssassin

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.