geforkt von Mirrors/Paper
SPIGOT-213: Add method to enable / disable AI for mobs
Dieser Commit ist enthalten in:
Ursprung
6bf25cde7e
Commit
6067e54dd2
@ -528,4 +528,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
public AttributeInstance getAttribute(Attribute attribute) {
|
||||
return getHandle().craftAttributes.getAttribute(attribute);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAI(boolean ai) {
|
||||
if (this.getHandle() instanceof EntityInsentient) {
|
||||
((EntityInsentient) this.getHandle()).m(!ai); // PAIL: rename
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasAI() {
|
||||
return (this.getHandle() instanceof EntityInsentient) ? !((EntityInsentient) this.getHandle()).cR() : false; // PAIL: rename
|
||||
}
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren