public interface Villager extends AbstractVillager
| Modifier and Type | Interface and 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 and Description |
|---|---|
void |
clearReputations()
Clear all reputations from this villager.
|
@NotNull Villager.Profession |
getProfession()
Gets the current profession of this villager.
|
Reputation |
getReputation(@NotNull UUID uniqueId)
Get the
reputation
for a specific player by UUID. |
@NotNull Map<UUID,Reputation> |
getReputations()
Get all
reputations
for all players mapped by their unique IDs. |
int |
getRestocksToday()
Gets the amount of times a villager has restocked their trades today
|
int |
getVillagerExperience()
Gets the trading experience of this villager.
|
int |
getVillagerLevel()
Gets the level of this villager.
|
@NotNull Villager.Type |
getVillagerType()
Gets the current type of this villager.
|
void |
setProfession(@NotNull Villager.Profession profession)
Sets the new profession of this villager.
|
void |
setReputation(@NotNull UUID uniqueId,
Reputation reputation)
Set the
reputation
for a specific player by UUID. |
void |
setReputations(@NotNull Map<UUID,Reputation> reputations)
Set all
reputations
for all players mapped by their unique IDs. |
void |
setRestocksToday(int restocksToday)
Sets the amount of times a villager has restocked their trades today
|
void |
setVillagerExperience(int experience)
Sets the trading experience of this villager.
|
void |
setVillagerLevel(int level)
Sets the level of this villager.
|
void |
setVillagerType(@NotNull Villager.Type type)
Sets the new type of this villager.
|
boolean |
sleep(@NotNull 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, resetOfferscanBreed, getAgeLock, setAgeLock, setBreedgetAge, isAdult, setAdult, setAge, setBabygetHeadRotationSpeed, getMaxHeadPitch, getPathfinder, getTarget, isAware, isInDaylight, lookAt, lookAt, lookAt, lookAt, lookAt, lookAt, setAware, setTargetaddPotionEffect, addPotionEffect, addPotionEffects, attack, clearActiveItem, getActiveItem, getActivePotionEffects, getArrowCooldown, getArrowsInBody, getArrowsStuck, getCanPickupItems, getCategory, getCollidableExemptions, getEquipment, getEyeHeight, getEyeHeight, getEyeLocation, getHandRaised, getHandRaisedTime, getHurtDirection, getItemUseRemainingTime, getKiller, getLastDamage, getLastTwoTargetBlocks, getLeashHolder, getLineOfSight, getMaximumAir, getMaximumNoDamageTicks, getMemory, getNoDamageTicks, getPotionEffect, getRemainingAir, getRemoveWhenFarAway, getShieldBlockingDelay, getTargetBlock, getTargetBlock, getTargetBlock, getTargetBlockExact, getTargetBlockExact, getTargetBlockFace, getTargetBlockFace, getTargetBlockInfo, getTargetBlockInfo, getTargetEntity, getTargetEntity, getTargetEntityInfo, getTargetEntityInfo, hasAI, hasLineOfSight, hasLineOfSight, hasPotionEffect, isCollidable, isGliding, isHandRaised, isInvisible, isJumping, isLeashed, isRiptiding, isSleeping, isSwimming, playPickupItemAnimation, playPickupItemAnimation, rayTraceBlocks, rayTraceBlocks, removePotionEffect, setAI, setArrowCooldown, setArrowsInBody, setArrowsStuck, setCanPickupItems, setCollidable, setGliding, setHurtDirection, setInvisible, setJumping, setKiller, setLastDamage, setLeashHolder, setMaximumAir, setMaximumNoDamageTicks, setMemory, setNoDamageTicks, setRemainingAir, setRemoveWhenFarAway, setShieldBlockingDelay, setSwimming, swingMainHand, swingOffHandgetAttribute, registerAttributedamage, damage, getAbsorptionAmount, getHealth, getMaxHealth, resetMaxHealth, setAbsorptionAmount, setHealth, setMaxHealthaddPassenger, addScoreboardTag, asHoverEvent, eject, fromMobSpawner, getBoundingBox, getChunk, getEntityId, getEntitySpawnReason, getFacing, getFallDistance, getFireTicks, getHeight, getLastDamageCause, getLocation, getLocation, getMaxFireTicks, getNearbyEntities, getOrigin, getPassenger, getPassengers, getPistonMoveReaction, getPortalCooldown, getPose, getScoreboardTags, getServer, getTicksLived, getType, getUniqueId, getVehicle, getVelocity, getWidth, getWorld, hasGravity, isCustomNameVisible, isDead, isEmpty, isGlowing, isInBubbleColumn, isInLava, isInRain, isInsideVehicle, isInvulnerable, isInWater, isInWaterOrBubbleColumn, isInWaterOrRain, isInWaterOrRainOrBubbleColumn, isOnGround, isPersistent, isSilent, isTicking, 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, teleportAsync, teleportAsyncgetMetadata, hasMetadata, removeMetadata, setMetadatagetName, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessageaudience, audience, clearTitle, empty, hideBossBar, openBook, openBook, playSound, playSound, resetTitle, sendActionBar, sendActionBar, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeader, sendPlayerListHeaderAndFooter, sendPlayerListHeaderAndFooter, showBossBar, showTitle, stopSound, toAudienceaddAttachment, addAttachment, addAttachment, addAttachment, getEffectivePermissions, hasPermission, hasPermission, isPermissionSet, isPermissionSet, recalculatePermissions, removeAttachmentisOp, setOpcustomName, customName, getCustomName, setCustomNamegetPersistentDataContainerasHoverEvent, unboxlaunchProjectile, launchProjectileclearLootTable, getLootTable, getSeed, hasLootTable, setLootTable, setLootTable, setSeedgetRecipe, getRecipeCount, getRecipes, getTrader, isTrading, setRecipe, setRecipes@NotNull @NotNull Villager.Profession getProfession()
void setProfession(@NotNull @NotNull Villager.Profession profession)
profession - New profession.@NotNull @NotNull Villager.Type getVillagerType()
void setVillagerType(@NotNull @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 < 0int getRestocksToday()
void setRestocksToday(int restocksToday)
restocksToday - new restock countboolean sleep(@NotNull @NotNull Location location)
location - the location of the bedvoid wakeup()
IllegalStateException - if not sleeping@Nullable Reputation getReputation(@NotNull @NotNull UUID uniqueId)
reputation
for a specific player by UUID.uniqueId - The UUID of the player to get the reputation of.@NotNull @NotNull Map<UUID,Reputation> getReputations()
reputations
for all players mapped by their unique IDs.reputations for all players
in a copied map.void setReputation(@NotNull @NotNull UUID uniqueId, @NotNull Reputation reputation)
reputation
for a specific player by UUID.uniqueId - The UUID of the player to set the reputation of.reputation - The reputation to set.void setReputations(@NotNull @NotNull Map<UUID,Reputation> reputations)
reputations
for all players mapped by their unique IDs.reputations - All reputations
for all players mapped by their unique IDs.void clearReputations()
Copyright © 2022. All rights reserved.