Jump to content

[SOLVED]Entities spawning and almost immediately vanishing on item right click


The_Fireplace

Recommended Posts

I have an item that spawns a Snowman when right clicked, however, the snowman vanishes after between 1/2 and 2 seconds.

Here is my code:

 

@Override
public ItemStack onItemRightClick(ItemStack is, World world, EntityPlayer player){
if (!world.isRemote)
        {
        	Entity entity=new EntitySnowman(world);
        	entity.posX=player.posX;
        	entity.posZ=player.posZ;
            	entity.posY=player.posY;
                world.spawnEntityInWorld(entity);
        }
        return is;
}

 

If there's any more info you need, please, let me know.

If I helped please press the Thank You button.

 

Check out my mods at http://www.curse.com/users/The_Fireplace/projects

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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