Can't spawn hbm's mob correctly
sdddddf80 opened this issue · 5 comments
Describe the bug
I try to spawn hbm's mobs, but even though I write the code as same as the code in BossSpawnHandler.java
package com.hbm.blocks.siege;
import com.hbm.blocks.BlockBase;
import com.hbm.entity.mob.EntityFBI;
import com.hbm.entity.mob.EntityMaskMan;
import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import net.minecraftforge.event.ForgeEventFactory;
public class Basement extends BlockBase {
public Basement() {
super(Material.iron);
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ)
{
if(world.isRemote){
EntityLiving FBI = new EntityMaskMan(world);
FBI.setLocationAndAngles(x, y, z, world.rand.nextFloat() * 360.0F, 0.0F);
world.spawnEntityInWorld(FBI);
ForgeEventFactory.doSpecialSpawn(FBI , world, x, y, z);
FBI.onSpawnWithEgg(null);
}
return true;
}
world.isRemote
means it's client-side only, you want to do the opposite.
Well removing world.isRemote
doesn't change the situation😹