接口 Piglin

所有超级接口:
Ageable, Attributable, CommandSender, Creature, Damageable, Enemy, Entity, InventoryHolder, Leashable, LivingEntity, Lootable, Metadatable, Mob, Monster, Nameable, Permissible, PersistentDataHolder, PiglinAbstract, ProjectileSource, ServerOperator

public interface Piglin extends PiglinAbstract, InventoryHolder
代表一只猪灵。
  • 方法详细资料

    • isAbleToHunt

      boolean isAbleToHunt()
      获取猪灵是否能猎杀疣猪兽。

      原文:Get whether the piglin is able to hunt hoglins.

      返回:
      猪灵是否能猎杀疣猪兽
    • setIsAbleToHunt

      void setIsAbleToHunt(boolean flag)
      设置猪灵是否能猎杀疣猪兽。

      原文:Sets whether the piglin is able to hunt hoglins.

      参数:
      flag - 猪灵是否能猎杀疣猪兽
    • addBarterMaterial

      boolean addBarterMaterial(@NotNull @NotNull Material material)
      添加一个材料到允许以物易物的材料列表中。

      原文:Adds a material to the allowed list of materials to barter with.

      参数:
      material - 要添加的材料
      返回:
      如果物品已成功添加则为 true,否则为 false
    • removeBarterMaterial

      boolean removeBarterMaterial(@NotNull @NotNull Material material)
      从允许以物易物的材料列表中移除一个材料。

      原文:Removes a material from the allowed list of materials to barter with. 注意:无法覆盖默认的以物易物物品金锭作为支付物。要屏蔽金锭请参见 PiglinBarterEvent。

      参数:
      material - 要移除的材料
      返回:
      如果物品已成功移除则为 true,否则为 false
    • addMaterialOfInterest

      boolean addMaterialOfInterest(@NotNull @NotNull Material material)
      添加一个猪灵会拾取并存储在其物品栏中的材料。

      原文:Adds a material the piglin will pickup and store in his inventory.

      参数:
      material - 你希望猪灵感兴趣的材料
      返回:
      如果物品已成功添加则为 true,否则为 false
    • removeMaterialOfInterest

      boolean removeMaterialOfInterest(@NotNull @NotNull Material material)
      从猪灵会拾取的材料列表中移除一个材料。

      原文:Removes a material from the list of materials the piglin will pickup. 注意:无法覆盖猪灵默认拾取的物品列表。要取消拾取请参见 EntityPickupItemEvent。

      参数:
      material - 你希望从兴趣列表中移除的材料
      返回:
      如果物品已成功移除则为 true,否则为 false
    • getInterestList

      @NotNull @NotNull Set<Material> getInterestList()
      返回猪灵会拾取的材料的不可变集合。

      原文:Returns a immutable set of materials the piglins will pickup.
      注意:此集合不包含默认设置的物品。要操作那些物品请参见 EntityPickupItemEvent。

      返回:
      一个不可变的材料集合
    • getBarterList

      @NotNull @NotNull Set<Material> getBarterList()
      返回猪灵会以物易物的材料的不可变集合。

      原文:Returns a immutable set of materials the piglins will barter with. 注意:此集合不包含默认设置的物品。要操作那些物品请参见 PiglinBarterEvent。

      返回:
      一个不可变的材料集合