mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-08 03:22:19 +01:00
Add set/isAware to disable Vanilla AI components of a Mob
By: konsolas <vincentyntang@gmail.com>
This commit is contained in:
parent
0455dbf2f7
commit
188f017bdd
2 changed files with 26 additions and 0 deletions
|
@ -443,6 +443,8 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
||||||
/**
|
/**
|
||||||
* Sets whether an entity will have AI.
|
* Sets whether an entity will have AI.
|
||||||
*
|
*
|
||||||
|
* The entity will be completely unable to move if it has no AI.
|
||||||
|
*
|
||||||
* @param ai whether the mob will have AI or not.
|
* @param ai whether the mob will have AI or not.
|
||||||
*/
|
*/
|
||||||
void setAI(boolean ai);
|
void setAI(boolean ai);
|
||||||
|
@ -450,6 +452,8 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
||||||
/**
|
/**
|
||||||
* Checks whether an entity has AI.
|
* Checks whether an entity has AI.
|
||||||
*
|
*
|
||||||
|
* The entity will be completely unable to move if it has no AI.
|
||||||
|
*
|
||||||
* @return true if the entity has AI, otherwise false.
|
* @return true if the entity has AI, otherwise false.
|
||||||
*/
|
*/
|
||||||
boolean hasAI();
|
boolean hasAI();
|
||||||
|
|
|
@ -25,4 +25,26 @@ public interface Mob extends LivingEntity, Lootable {
|
||||||
*/
|
*/
|
||||||
@Nullable
|
@Nullable
|
||||||
public LivingEntity getTarget();
|
public LivingEntity getTarget();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets whether this mob is aware of its surroundings.
|
||||||
|
*
|
||||||
|
* Unaware mobs will still move if pushed, attacked, etc. but will not move
|
||||||
|
* or perform any actions on their own. Unaware mobs may also have other
|
||||||
|
* unspecified behaviours disabled, such as drowning.
|
||||||
|
*
|
||||||
|
* @param aware whether the mob is aware
|
||||||
|
*/
|
||||||
|
public void setAware(boolean aware);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets whether this mob is aware of its surroundings.
|
||||||
|
*
|
||||||
|
* Unaware mobs will still move if pushed, attacked, etc. but will not move
|
||||||
|
* or perform any actions on their own. Unaware mobs may also have other
|
||||||
|
* unspecified behaviours disabled, such as drowning.
|
||||||
|
*
|
||||||
|
* @return whether the mob is aware
|
||||||
|
*/
|
||||||
|
public boolean isAware();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue