AbstractVillager
, Ageable
, Attributable
, CommandSender
, Creature
, Damageable
, Entity
, InventoryHolder
, LivingEntity
, Lootable
, Merchant
, Metadatable
, Mob
, Nameable
, NPC
, Permissible
, PersistentDataHolder
, ProjectileSource
, ServerOperator
public interface Villager extends AbstractVillager
Modifier and Type | Interface | Description |
---|---|---|
static class |
Villager.Profession |
Represents the various different Villager professions there may be.
|
static class |
Villager.Type |
Represents Villager type, usually corresponding to what biome they spawn
in.
|
Entity.Spigot
Modifier and Type | Method | Description |
---|---|---|
Villager.Profession |
getProfession() |
Gets the current profession of this villager.
|
int |
getVillagerExperience() |
Gets the trading experience of this villager.
|
int |
getVillagerLevel() |
Gets the level of this villager.
|
Villager.Type |
getVillagerType() |
Gets the current type of this villager.
|
void |
setProfession(Villager.Profession profession) |
Sets the new profession of this villager.
|
void |
setVillagerExperience(int experience) |
Sets the trading experience of this villager.
|
void |
setVillagerLevel(int level) |
Sets the level of this villager.
|
void |
setVillagerType(Villager.Type type) |
Sets the new type of this villager.
|
boolean |
sleep(Location location) |
Attempts to make this villager sleep at the given location.
|
void |
wakeup() |
Causes this villager to wake up if he's currently sleeping.
|
getInventory
canBreed, getAge, getAgeLock, isAdult, setAdult, setAge, setAgeLock, setBaby, setBreed
getAttribute
getName, sendMessage, sendMessage
damage, damage, getAbsorptionAmount, getHealth, getMaxHealth, resetMaxHealth, setAbsorptionAmount, setHealth, setMaxHealth
addPassenger, addScoreboardTag, eject, getBoundingBox, getEntityId, getFacing, getFallDistance, getFireTicks, getHeight, getLastDamageCause, getLocation, getLocation, getMaxFireTicks, getNearbyEntities, getPassenger, getPassengers, getPistonMoveReaction, getPortalCooldown, getPose, getScoreboardTags, getServer, getTicksLived, getType, getUniqueId, getVehicle, getVelocity, getWidth, getWorld, hasGravity, isCustomNameVisible, isDead, isEmpty, isGlowing, isInsideVehicle, isInvulnerable, isOnGround, isPersistent, isSilent, isValid, leaveVehicle, playEffect, remove, removePassenger, removeScoreboardTag, setCustomNameVisible, setFallDistance, setFireTicks, setGlowing, setGravity, setInvulnerable, setLastDamageCause, setPassenger, setPersistent, setPortalCooldown, setRotation, setSilent, setTicksLived, setVelocity, spigot, teleport, teleport, teleport, teleport
addPotionEffect, addPotionEffect, addPotionEffects, getActivePotionEffects, getCanPickupItems, getEquipment, getEyeHeight, getEyeHeight, getEyeLocation, getKiller, getLastDamage, getLastTwoTargetBlocks, getLeashHolder, getLineOfSight, getMaximumAir, getMaximumNoDamageTicks, getMemory, getNoDamageTicks, getPotionEffect, getRemainingAir, getRemoveWhenFarAway, getTargetBlock, getTargetBlockExact, getTargetBlockExact, hasAI, hasLineOfSight, hasPotionEffect, isCollidable, isGliding, isLeashed, isRiptiding, isSleeping, isSwimming, rayTraceBlocks, rayTraceBlocks, removePotionEffect, setAI, setCanPickupItems, setCollidable, setGliding, setLastDamage, setLeashHolder, setMaximumAir, setMaximumNoDamageTicks, setMemory, setNoDamageTicks, setRemainingAir, setRemoveWhenFarAway, setSwimming
getLootTable, getSeed, setLootTable, setSeed
getRecipe, getRecipeCount, getRecipes, getTrader, isTrading, setRecipe, setRecipes
getMetadata, hasMetadata, removeMetadata, setMetadata
getCustomName, setCustomName
addAttachment, addAttachment, addAttachment, addAttachment, getEffectivePermissions, hasPermission, hasPermission, isPermissionSet, isPermissionSet, recalculatePermissions, removeAttachment
getPersistentDataContainer
launchProjectile, launchProjectile
isOp, setOp
@NotNull Villager.Profession getProfession()
void setProfession(@NotNull Villager.Profession profession)
profession
- New profession.@NotNull Villager.Type getVillagerType()
void setVillagerType(@NotNull Villager.Type type)
type
- New type.int getVillagerLevel()
void setVillagerLevel(int level)
level
- the new levelIllegalArgumentException
- if level not between [1, 5]int getVillagerExperience()
void setVillagerExperience(int experience)
experience
- new experienceIllegalArgumentException
- if experience < 0boolean sleep(@NotNull Location location)
location
- the location of the bedvoid wakeup()
IllegalStateException
- if not sleepingCopyright © 2019. All rights reserved.