Files
DeltaZern/paper-api/src/main/java/org/bukkit/entity/Mob.java
T
Aikar 397d3cac4b LootTable API
Provides API to control what Loot Table an object uses.

Also provides an Event to control if a lootable inventory should
auto replenish for a player.

Provides methods to determine players looted state for an object
2016-05-01 15:19:49 -04:00

73 lines
2.3 KiB
Java

package org.bukkit.entity;
import org.bukkit.Sound;
import org.bukkit.loot.Lootable;
import org.jetbrains.annotations.Nullable;
/**
* Represents a Mob. Mobs are living entities with simple AI.
*/
public interface Mob extends LivingEntity, Lootable {
/**
* Instructs this Mob to set the specified LivingEntity as its target.
* <p>
* Hostile creatures may attack their target, and friendly creatures may
* follow their target.
*
* @param target New LivingEntity to target, or null to clear the target
*/
public void setTarget(@Nullable LivingEntity target);
/**
* Gets the current target of this Mob
*
* @return Current target of this creature, or null if none exists
*/
@Nullable
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();
/**
* Get the {@link Sound} this mob makes while ambiently existing. This sound
* may change depending on the current state of the entity, and may also
* return null under specific conditions. This sound is not constant.
* For instance, villagers will make different passive noises depending
* on whether or not they are actively trading with a player, or make no
* ambient noise while sleeping.
*
* @return the ambient sound, or null if this entity is ambiently quiet
*/
@Nullable
public Sound getAmbientSound();
// Paper start - LootTable API
@Override
default void setLootTable(final @Nullable org.bukkit.loot.LootTable table, final long seed) {
this.setLootTable(table);
this.setSeed(seed);
}
// Paper end - LootTable API
}