Hbm's Nuclear Tech Mod

Hbm's Nuclear Tech Mod

1M Downloads

Can't spawn hbm's mob correctly

sdddddf80 opened this issue · 5 comments

commented

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;
}

QQ截图20230506230737

, the mob spawned has no ai, no collision volume.
QQ截图20230506230814

commented

world.isRemote means it's client-side only, you want to do the opposite.

Well removing world.isRemote doesn't change the situation😹

commented

You dont remove it, you insert an ! At the beginning

commented

Yeah, make it a not (!) world.isRemote

commented

world.isRemote means it's client-side only, you want to do the opposite.

commented

God I ignore that