Jump to content

How to get a monster to spawn during the day


pmardle

Recommended Posts

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..

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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...

Link to comment
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.
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...

×   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.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.