Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.14.4]modifying spawners


Recommended Posts

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.

Link to post
Share on other sites
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
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.