Interface AbstractVillager

All Superinterfaces:
Ageable, Attributable, Audience, Breedable, CommandSender, Creature, Damageable, DataComponentView, Entity, Frictional, HoverEventSource<HoverEvent.ShowEntity>, InventoryHolder, Leashable, LivingEntity, Lootable, Merchant, Metadatable, Mob, Nameable, NPC, Permissible, PersistentDataHolder, PersistentDataViewHolder, Pointered, ProjectileSource, ServerOperator, Sound.Emitter
All Known Subinterfaces:
Villager, WanderingTrader

public interface AbstractVillager extends Breedable, NPC, InventoryHolder, Merchant
Represents a villager NPC
  • Method Details

    • getInventory

      @NotNull @NotNull Inventory getInventory()
      Gets this villager's inventory.
      Note that this inventory is not the Merchant inventory, rather, it is the items that a villager might have collected (from harvesting crops, etc.) Get the object's inventory.
      Specified by:
      getInventory in interface InventoryHolder
      Returns:
      The inventory.
    • resetOffers

      void resetOffers()
      Reset this villager's trade offers.
      For Villagers, only two trades are created, rather than the number of trades expected for the villager's level. You should use Villager.addTrades(int) to add the remaining trades.