Files
CustomNPC-Plus/src/main/java/noppes/npcs/entity/EntityNpcSlime.java
T

42 lines
1.0 KiB
Java
Raw Normal View History

2018-09-13 12:03:28 -04:00
package noppes.npcs.entity;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import noppes.npcs.entity.data.ModelData;
2018-09-13 12:03:28 -04:00
2025-03-12 20:12:01 -04:00
public class EntityNpcSlime extends EntityNPCInterface {
public EntityNpcSlime(World world) {
2018-09-13 12:03:28 -04:00
super(world);
2025-03-12 20:12:01 -04:00
scaleX = 2f;
scaleY = 2f;
scaleZ = 2f;
display.texture = "customnpcs:textures/entity/slime/Slime.png";
width = 0.8f;
height = 0.8f;
}
@Override
public void updateHitbox() {
width = 0.8f;
height = 0.8f;
}
@Override
public void onUpdate() {
isDead = true;
if (!worldObj.isRemote) {
NBTTagCompound compound = new NBTTagCompound();
writeToNBT(compound);
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
npc.readFromNBT(compound);
ModelData data = npc.modelData;
data.setEntityClass(EntityNpcSlime.class);
worldObj.spawnEntityInWorld(npc);
}
2018-09-13 12:03:28 -04:00
super.onUpdate();
}
}