mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-20 22:42:19 +00:00
26 lines
634 B
Java
26 lines
634 B
Java
package noppes.npcs.ai;
|
|
|
|
import net.minecraft.entity.ai.EntityAIBase;
|
|
import noppes.npcs.constants.AiMutex;
|
|
import noppes.npcs.entity.EntityNPCInterface;
|
|
|
|
public class EntityAIWorldLines extends EntityAIBase {
|
|
|
|
private EntityNPCInterface npc;
|
|
public EntityAIWorldLines(EntityNPCInterface npc){
|
|
this.npc = npc;
|
|
this.setMutexBits(AiMutex.PASSIVE);
|
|
}
|
|
|
|
@Override
|
|
public boolean shouldExecute() {
|
|
return !npc.isAttacking() && !npc.isKilled() && npc.advanced.hasWorldLines() && npc.getRNG().nextInt(1900) == 1;
|
|
}
|
|
|
|
public void startExecuting()
|
|
{
|
|
npc.saySurrounding(npc.advanced.getWorldLine());
|
|
}
|
|
|
|
}
|