mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 19:49:35 +01:00
SPIGOT-213: Add method to enable / disable AI for mobs
By: Redrield <purbleguy@gmail.com>
This commit is contained in:
parent
454a2b88bd
commit
c75ec3cef3
1 changed files with 12 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue