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

Hi,

 

I have a Mob that I want to spawn via a mob spawner but allow it to spawn during the day.

 

I have the spawner working to spawn it during the night, but I cannot figure out how to get it to work during the day.  I tried changing hte mod to a creature, but then the spawner doesn't work at all...

 

I would also like to increase its activation range from the standard up to about 40-50 blocks..

 

I have looked for ages for tutorials, but have come up empty handed...

 

Thanks in advance..

I'm assuming it would be the same thing you would do to get mobs naturally spawning in the day, putting this code in the EntityMobname:

 

@Override
protected boolean isValidLightLevel()
{
    return true; //don't care about the light level to spawn
}

 

If it is not your own mob, I'm not sure.

  • Author

Ok.. my code

 

Mod File

EntityRegistry.registerGlobalEntityID(EntityBarbarian.class, "Barbarian", EntityRegistry.findGlobalUniqueEntityId(), 32324, 2243);
	        EntityRegistry.registerModEntity(EntityBarbarian.class, "Barbarian", EntityRegistry.findGlobalUniqueEntityId(), this, 160, 1, true);
	        LanguageRegistry.instance().addStringLocalization("entity.Barbarian.name", "Barbarian");
	    	EntityRegistry.addSpawn(EntityBarbarian.class, 8, 1, 3, EnumCreatureType.monster, <Biomes Omitted to save space>);

 

Monster Spawner Code..

 

world.setBlockWithNotify(blockX+2, blockY-1, blockZ+2, Block.mobSpawner.blockID);
TileEntityMobSpawner TEMS = (TileEntityMobSpawner)world.getBlockTileEntity(blockX+2, blockY-1, blockZ+2);
    			            if (TEMS != null)
    			            {
    			            	TEMS.setMobID("Barbarian");
    			            }

 

Thanks in advance...

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.