public class GlowVillager extends GlowAgeable implements org.bukkit.entity.Villager
height, width
deathTicks, health, maxHealth, movement, speed, taskManager
active, airDrag, applyDragBeforeAccel, boundingBox, ENTITY_ID_NOBODY, entityId, gravityAccel, liquidDrag, location, metadata, passengerChanged, previousLocation, removed, server, slipMultiplier, teleported, ticksLived, vehicle, velocity, velocityChanged, world, worldLock
Constructor and Description |
---|
GlowVillager(org.bukkit.Location location)
Creates a villager with a random profession.
|
Modifier and Type | Method and Description |
---|---|
void |
clearRecipes()
Clears the recipes of this villager.
|
void |
damage(double amount,
org.bukkit.entity.Entity source,
org.bukkit.event.entity.EntityDamageEvent.DamageCause cause) |
boolean |
entityInteract(GlowPlayer player,
InteractEntityMessage message) |
protected org.bukkit.Sound |
getAmbientSound()
Get the ambient sound this entity makes randomly, or null for silence.
|
org.bukkit.entity.Villager.Career |
getCareer() |
static org.bukkit.entity.Villager.Career |
getCareerById(int id,
org.bukkit.entity.Villager.Profession profession)
Gets the career associated with a given ID and profession.
|
static int |
getCareerId(org.bukkit.entity.Villager.Career career)
Gets the numerical ID of the given career.
|
int |
getCareerLevel()
Get the current level of this villager's trading options.
|
protected org.bukkit.Sound |
getDeathSound()
Get the death sound of this entity, or null for silence.
|
protected org.bukkit.Sound |
getHurtSound()
Get the hurt sound of this entity, or null for silence.
|
org.bukkit.inventory.Inventory |
getInventory() |
org.bukkit.entity.Villager.Profession |
getProfession() |
static org.bukkit.entity.Villager.Profession |
getProfessionById(int professionId)
Gets the
Villager.Profession corresponding to the given ID. |
static org.bukkit.entity.Villager.Profession |
getRandomProfession(Random random)
Gets a random
Villager.Profession . |
org.bukkit.inventory.MerchantRecipe |
getRecipe(int index) |
int |
getRecipeCount() |
List<org.bukkit.inventory.MerchantRecipe> |
getRecipes() |
int |
getRiches() |
GlowHumanEntity |
getTrader()
The trader this villager is currently trading with.
|
boolean |
isTrading() |
static boolean |
isValidProfession(int professionId)
Checks whether or not the given
Villager.Profession ID is valid. |
boolean |
isWilling()
Whether or not this villager is willing to mate.
|
void |
setCareer(org.bukkit.entity.Villager.Career career) |
void |
setCareer(org.bukkit.entity.Villager.Career career,
boolean resetTrades) |
void |
setCareerLevel(int careerLevel)
Set the current level of this villager's trading options.
|
void |
setProfession(org.bukkit.entity.Villager.Profession profession) |
void |
setRecipe(int index,
org.bukkit.inventory.MerchantRecipe recipe) |
void |
setRecipes(List<org.bukkit.inventory.MerchantRecipe> recipes) |
void |
setRiches(int riches) |
void |
setTrader(GlowHumanEntity trader)
The trader this villager is currently trading with.
|
void |
setWilling(boolean willing)
Whether or not this villager is willing to mate.
|
canBreed, canGrow, computeGrowthAmount, createBaby, createSpawnMessage, getAge, getAgeLock, getForcedAge, getInLove, getParent, getSoundPitch, grow, isAdult, pulse, setAdult, setAge, setAgeLock, setBaby, setBreed, setForcedAge, setInLove, setParent, setScale, setScaleForAge
getTarget, getType, setTarget
addPotionEffect, addPotionEffect, addPotionEffects, canTakeDamage, clearActivePotionEffects, createUpdateMessage, getActiveItem, getActivePotionEffects, getAmbientDelay, getArrowsStuck, getAttribute, getAttributeManager, getCanPickupItems, getDeathTicks, getEquipment, getEquipmentMonitor, getEyeHeight, getEyeHeight, getEyeLocation, getHandRaisedTime, getHeadYaw, getHealth, getItemUseRemainingTime, getKiller, getLastDamage, getLastDamager, getLastTwoTargetBlocks, getLastTwoTargetBlocks, getLineOfSight, getMaxHealth, getMaximumAir, getMaximumNoDamageTicks, getMovement, getNoDamageTicks, getPlayerDamageTick, getPotionEffect, getRemainingAir, getRemoveWhenFarAway, getShieldBlockingDelay, getSoundVolume, getSpeed, getState, getTargetBlock, getTargetBlock, getTaskManager, getVelocityFromMovement, hasAI, hasLineOfSight, hasPotionEffect, isArthropod, isCollidable, isFallFlying, isGliding, isHandRaised, isUndead, isWithinSolidBlock, jump, launchProjectile, launchProjectile, launchProjectile, launchProjectile, playAnimation, pulsePhysics, removePotionEffect, reset, resetMaxHealth, setAI, setArrowsStuck, setCanPickupItems, setCollidable, setFallFlying, setGliding, setHeadYaw, setHealth, setKiller, setLastDamage, setLastDamager, setMaxHealth, setMaximumAir, setMaximumNoDamageTicks, setMovement, setNoDamageTicks, setOnGround, setPlayerDamageTick, setRemainingAir, setRemoveWhenFarAway, setShieldBlockingDelay, setSpeed, setState, tryUseTotem, updatePotionEffectsMetadata
addAttachment, addAttachment, addAttachment, addAttachment, addPassenger, addScoreboardTag, collide, createAfterSpawnMessage, damage, damage, damage, eject, equals, fromMobSpawner, getCardinalFacing, getChunk, getCustomName, getCustomTags, getDismountLocation, getEffectivePermissions, getEntityId, getFacing, getFallDistance, getFireTicks, getGravityAccel, getHeight, getLastDamageCause, getLeashedEntities, getLeashHolder, getLocation, getLocation, getMaxFireTicks, getMetadata, getMetadata, getMountLocation, getName, getNearbyEntities, getOrigin, getPassenger, getPassengers, getPistonMoveReaction, getPortalCooldown, getScoreboardTags, getServer, getTicksLived, getUniqueId, getVehicle, getVelocity, getWidth, getWorld, hasDefaultLandingBehavior, hasFriction, hasGravity, hashCode, hasMetadata, hasMoved, hasPermission, hasPermission, hasRotated, intersects, isCustomNameVisible, isDead, isEmpty, isGlowing, isInsideVehicle, isInvulnerable, isLeashed, isOnGround, isOp, isPermissionSet, isPermissionSet, isRemoved, isSilent, isTeleported, isTouchingMaterial, isValid, isWithinDistance, isWithinDistance, leaveVehicle, playEffect, playEffectKnownAndSelf, recalculatePermissions, remove, removeAttachment, removeMetadata, removePassenger, removeScoreboardTag, sendMessage, sendMessage, setAirDrag, setApplyDragBeforeAccel, setBoundingBox, setCustomName, setCustomNameVisible, setFallDistance, setFireTicks, setFriction, setGlowing, setGravity, setGravityAccel, setInvulnerable, setLastDamageCause, setLeashHolder, setLeashHolderUniqueId, setLiquidDrag, setMetadata, setOp, setPassenger, setPortalCooldown, setRawLocation, setRawLocation, setSilent, setSize, setTicksLived, setUniqueId, setVelocity, shouldSave, spigot, teleport, teleport, teleport, teleport, teleportToEnd, teleportToSpawn, toString, updateBoundingBox
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
public GlowVillager(org.bukkit.Location location)
location
- the locationpublic org.bukkit.entity.Villager.Profession getProfession()
getProfession
in interface org.bukkit.entity.Villager
public void setProfession(org.bukkit.entity.Villager.Profession profession)
setProfession
in interface org.bukkit.entity.Villager
public void setCareer(org.bukkit.entity.Villager.Career career)
setCareer
in interface org.bukkit.entity.Villager
public void setCareer(org.bukkit.entity.Villager.Career career, boolean resetTrades)
setCareer
in interface org.bukkit.entity.Villager
public List<org.bukkit.inventory.MerchantRecipe> getRecipes()
getRecipes
in interface org.bukkit.inventory.Merchant
public void setRecipes(List<org.bukkit.inventory.MerchantRecipe> recipes)
setRecipes
in interface org.bukkit.inventory.Merchant
public org.bukkit.inventory.MerchantRecipe getRecipe(int index) throws IndexOutOfBoundsException
getRecipe
in interface org.bukkit.inventory.Merchant
IndexOutOfBoundsException
public void setRecipe(int index, org.bukkit.inventory.MerchantRecipe recipe) throws IndexOutOfBoundsException
setRecipe
in interface org.bukkit.inventory.Merchant
IndexOutOfBoundsException
public int getRecipeCount()
getRecipeCount
in interface org.bukkit.inventory.Merchant
public void clearRecipes()
public org.bukkit.inventory.Inventory getInventory()
getInventory
in interface org.bukkit.entity.Villager
getInventory
in interface org.bukkit.inventory.InventoryHolder
public boolean isTrading()
isTrading
in interface org.bukkit.inventory.Merchant
public void setCareerLevel(int careerLevel)
If 0, the next trade will assign a new career and set the career level to 1.
careerLevel
- the level of this villager's trading optionspublic boolean entityInteract(GlowPlayer player, InteractEntityMessage message)
entityInteract
in class GlowAgeable
protected org.bukkit.Sound getHurtSound()
GlowLivingEntity
getHurtSound
in class GlowLivingEntity
protected org.bukkit.Sound getDeathSound()
GlowLivingEntity
getDeathSound
in class GlowLivingEntity
protected org.bukkit.Sound getAmbientSound()
GlowLivingEntity
getAmbientSound
in class GlowLivingEntity
public void damage(double amount, org.bukkit.entity.Entity source, org.bukkit.event.entity.EntityDamageEvent.DamageCause cause)
damage
in interface org.bukkit.entity.Damageable
damage
in class GlowLivingEntity
public static org.bukkit.entity.Villager.Career getCareerById(int id, org.bukkit.entity.Villager.Profession profession)
id
- the id of the careerprofession
- the professionpublic static int getCareerId(org.bukkit.entity.Villager.Career career)
career
- the careerpublic static org.bukkit.entity.Villager.Profession getRandomProfession(Random random)
Villager.Profession
.random
- the random instanceVillager.Profession
public static boolean isValidProfession(int professionId)
Villager.Profession
ID is valid.professionId
- the ID of the Villager.Profession
public static org.bukkit.entity.Villager.Profession getProfessionById(int professionId)
Villager.Profession
corresponding to the given ID.professionId
- the ID of the Villager.Profession
Villager.Profession
, or null if none existspublic org.bukkit.entity.Villager.Career getCareer()
getCareer
in interface org.bukkit.entity.Villager
public int getRiches()
getRiches
in interface org.bukkit.entity.Villager
public void setRiches(int riches)
setRiches
in interface org.bukkit.entity.Villager
public GlowHumanEntity getTrader()
getTrader
in interface org.bukkit.inventory.Merchant
public void setTrader(GlowHumanEntity trader)
trader
- the traderpublic boolean isWilling()
public void setWilling(boolean willing)
willing
- true if this villager is willing to mate, false otherwisepublic int getCareerLevel()
Copyright © 2021. All rights reserved.