Interface WanderingTrader

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

public interface WanderingTrader extends AbstractVillager
Represents a wandering trader NPC
  • Method Details

    • getDespawnDelay

      int getDespawnDelay()
      Gets the despawn delay before this WanderingTrader is forcibly despawned. If this is less than or equal to 0, then the trader will not be despawned.
      Returns:
      The despawn delay before this WanderingTrader is forcibly despawned
    • setDespawnDelay

      void setDespawnDelay(int despawnDelay)
      Sets the despawn delay before this WanderingTrader is forcibly despawned. If this is less than or equal to 0, then the trader will not be despawned.
      Parameters:
      despawnDelay - The new despawn delay before this WanderingTrader is forcibly despawned
    • setCanDrinkPotion

      void setCanDrinkPotion(boolean bool)
      Set if the Wandering Trader can and will drink an invisibility potion.
      Parameters:
      bool - whether the mob will drink
    • canDrinkPotion

      boolean canDrinkPotion()
      Get if the Wandering Trader can and will drink an invisibility potion.
      Returns:
      whether the mob will drink
    • setCanDrinkMilk

      void setCanDrinkMilk(boolean bool)
      Set if the Wandering Trader can and will drink milk.
      Parameters:
      bool - whether the mob will drink
    • canDrinkMilk

      boolean canDrinkMilk()
      Get if the Wandering Trader can and will drink milk.
      Returns:
      whether the mob will drink
    • getWanderingTowards

      @Nullable Location getWanderingTowards()
      Gets the location that this wandering trader is currently wandering towards.

      This will return null if the wandering trader has finished wandering towards the given location.

      Returns:
      the location currently wandering towards, or null if not wandering
    • setWanderingTowards

      void setWanderingTowards(@Nullable Location location)
      Sets the location that this wandering trader is currently wandering towards.

      This can be set to null to prevent the wandering trader from wandering further.

      Parameters:
      location - location to wander towards (world is ignored, will always use the entity's world)