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

I'm trying to spawn mob spawners that are not pigs and I am following the guide on this page: http://www.minecraftforge.net/wiki/Mob_Spawners but getSpawnerLogic

This is my code, I know I need to add one more line "zombies.getSpawnerLogic().setMobID(someEntityID);" but i get errors when I use those 2 functions

        				world.setBlock(xPos+x, yPos+y, zPos+z,Blocks.mob_spawner);
        				TileEntityMobSpawner zombies = (TileEntityMobSpawner)world.getTileEntity(xPos, yPos, zPos);

 

Any help would be appreciated.

I was hoping someone would show up to give you a better system then mine...because mine is horrible to code, but since it's been a day and no one has, I'll give you mine. But please, someone who has a better system, please help this guy out! Mine only lets me do minor default things, and I know there's a way to code more advanced things! Anyway...

TileEntityMobSpawner ttsnimspawner = (TileEntityMobSpawner)world.getTileEntity(i + 6, j + 11, k + 6);
	if (ttsnimspawner == null) {
		System.err.printf("TTSnimSpawner is null!?!\n");
	} else {
		ttsnimspawner.func_145881_a().setEntityName("Skeleton");
	}

The main thing you'll want is to use that if statement, cause if, for some reason, the spawner isn't at the location you specified (maybe terrain grew over it or something) then it will bug out and crash the mod. The if statement prevents that from happening. Unfortunately, this only works for default standard mob spawners... I'd love to know how to code something like...baby zombie spawners with armor or something like that, though (seriously, I know there's a way!)

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.