接口 Piglin

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

public interface Piglin extends PiglinAbstract, InventoryHolder
Represents a Piglin.
  • 方法详细资料

    • isAbleToHunt

      boolean isAbleToHunt()
      Get whether the piglin is able to hunt hoglins.
      返回:
      Whether the piglin is able to hunt hoglins
    • setIsAbleToHunt

      void setIsAbleToHunt(boolean flag)
      Sets whether the piglin is able to hunt hoglins.
      参数:
      flag - Whether the piglin is able to hunt hoglins.
    • addBarterMaterial

      boolean addBarterMaterial(@NotNull @NotNull Material material)
      Adds a material to the allowed list of materials to barter with.
      参数:
      material - The material to add
      返回:
      true if the item has been added successfully, false otherwise
    • removeBarterMaterial

      boolean removeBarterMaterial(@NotNull @NotNull Material material)
      Removes a material from the allowed list of materials to barter with. Note: It's not possible to override the default bartering item gold_ingots as payment. To block gold_ingots see PiglinBarterEvent.
      参数:
      material - The material to remove
      返回:
      true if the item has been removed successfully, false otherwise
    • addMaterialOfInterest

      boolean addMaterialOfInterest(@NotNull @NotNull Material material)
      Adds a material the piglin will pickup and store in his inventory.
      参数:
      material - The material you want the piglin to be interested in
      返回:
      true if the item has been added successfully, false otherwise
    • removeMaterialOfInterest

      boolean removeMaterialOfInterest(@NotNull @NotNull Material material)
      Removes a material from the list of materials the piglin will pickup. Note: It's not possible to override the default list of item the piglin will pickup. To cancel pickup see EntityPickupItemEvent.
      参数:
      material - The material you want removed from the interest list
      返回:
      true if the item has been removed successfully, false otherwise
    • getInterestList

      @NotNull @NotNull Set<Material> getInterestList()
      Returns a immutable set of materials the piglins will pickup.
      Note: This set will not include the items that are set by default. To interact with those items see EntityPickupItemEvent.
      返回:
      An immutable materials set
    • getBarterList

      @NotNull @NotNull Set<Material> getBarterList()
      Returns a immutable set of materials the piglins will barter with. Note: This set will not include the items that are set by default. To interact with those items see PiglinBarterEvent.
      返回:
      An immutable materials set