接口 Guardian
- 所有超级接口:
Attributable,CommandSender,Creature,Damageable,Enemy,Entity,Leashable,LivingEntity,Lootable,Metadatable,Mob,Monster,Nameable,Permissible,PersistentDataHolder,ProjectileSource,ServerOperator
- 所有已知子接口:
ElderGuardian
-
嵌套类概要
从接口继承的嵌套类/接口 org.bukkit.entity.Entity
Entity.Spigot -
方法概要
修饰符和类型方法说明int获取激光攻击持续的时长(以 tick 为单位)。int获取自守卫者发起激光攻击以来经过的 tick 数。booleanhasLaser()获取守卫者的激光是否处于激活状态。booleanisElder()已过时。booleanisMoving()检测此守卫者是否正在移动。voidsetElder(boolean shouldBeElder) 已过时。必须生成新的ElderGuardianbooleansetLaser(boolean activated) 设置守卫者的激光是否显示。voidsetLaserTicks(int ticks) 设置自守卫者发起激光攻击以来经过的 tick 数。从接口继承的方法 org.bukkit.attribute.Attributable
getAttribute从接口继承的方法 org.bukkit.command.CommandSender
getName, sendMessage, sendMessage, sendMessage, sendMessage从接口继承的方法 org.bukkit.entity.Damageable
damage, damage, damage, getAbsorptionAmount, getHealth, getMaxHealth, resetMaxHealth, setAbsorptionAmount, setHealth, setMaxHealth从接口继承的方法 org.bukkit.entity.Entity
addPassenger, addScoreboardTag, copy, copy, createSnapshot, eject, getAsString, getBoundingBox, getEntityId, getFacing, getFallDistance, getFireTicks, getFreezeTicks, getHeight, getLastDamageCause, getLocation, getLocation, getMaxFireTicks, getMaxFreezeTicks, getNearbyEntities, getPassenger, getPassengers, getPistonMoveReaction, getPortalCooldown, getPose, getScoreboardTags, getServer, getSpawnCategory, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getTicksLived, getTrackedBy, getType, getUniqueId, getVehicle, getVelocity, getWidth, getWorld, hasGravity, isCustomNameVisible, isDead, isEmpty, isFrozen, isGlowing, isInsideVehicle, isInvulnerable, isInWater, isInWorld, isOnGround, isPersistent, isSilent, isValid, isVisibleByDefault, isVisualFire, leaveVehicle, playEffect, remove, removePassenger, removeScoreboardTag, setCustomNameVisible, setFallDistance, setFireTicks, setFreezeTicks, setGlowing, setGravity, setInvulnerable, setLastDamageCause, setPassenger, setPersistent, setPortalCooldown, setRotation, setSilent, setTicksLived, setVelocity, setVisibleByDefault, setVisualFire, spigot, teleport, teleport, teleport, teleport从接口继承的方法 org.bukkit.entity.Leashable
getLeashHolder, isLeashed, setLeashHolder从接口继承的方法 org.bukkit.entity.LivingEntity
addPotionEffect, addPotionEffect, addPotionEffects, attack, canBreatheUnderwater, getActivePotionEffects, getArrowCooldown, getArrowsInBody, getCanPickupItems, getCategory, getCollidableExemptions, getDeathSound, getDrinkingSound, getEatingSound, getEquipment, getEyeHeight, getEyeHeight, getEyeLocation, getFallDamageSound, getFallDamageSoundBig, getFallDamageSoundSmall, getHurtSound, getItemInUse, getItemInUseTicks, getKiller, getLastDamage, getLastTwoTargetBlocks, getLineOfSight, getMaximumAir, getMaximumNoDamageTicks, getMemory, getNoActionTicks, getNoDamageTicks, getPotionEffect, getRemainingAir, getRemoveWhenFarAway, getTargetBlock, getTargetBlockExact, getTargetBlockExact, getWaypointColor, getWaypointStyle, hasAI, hasLineOfSight, hasPotionEffect, isClimbing, isCollidable, isGliding, isInvisible, isRiptiding, isSleeping, isSwimming, playHurtAnimation, rayTraceBlocks, rayTraceBlocks, removePotionEffect, setAI, setArrowCooldown, setArrowsInBody, setCanPickupItems, setCollidable, setGliding, setInvisible, setItemInUseTicks, setLastDamage, setMaximumAir, setMaximumNoDamageTicks, setMemory, setNoActionTicks, setNoDamageTicks, setRemainingAir, setRemoveWhenFarAway, setRiptiding, setSwimming, setWaypointColor, setWaypointStyle, swingMainHand, swingOffHand从接口继承的方法 org.bukkit.loot.Lootable
getLootTable, getSeed, setLootTable, setSeed从接口继承的方法 org.bukkit.metadata.Metadatable
getMetadata, hasMetadata, removeMetadata, setMetadata从接口继承的方法 org.bukkit.Nameable
getCustomName, setCustomName从接口继承的方法 org.bukkit.permissions.Permissible
addAttachment, addAttachment, addAttachment, addAttachment, getEffectivePermissions, hasPermission, hasPermission, isPermissionSet, isPermissionSet, recalculatePermissions, removeAttachment从接口继承的方法 org.bukkit.persistence.PersistentDataHolder
getPersistentDataContainer从接口继承的方法 org.bukkit.projectiles.ProjectileSource
launchProjectile, launchProjectile从接口继承的方法 org.bukkit.permissions.ServerOperator
isOp, setOp
-
方法详细资料
-
setLaser
boolean setLaser(boolean activated) 设置守卫者的激光是否显示。 必须存在一个目标。如果没有目标,激光将不会显示,且此方法将返回 false。原文:Sets whether the guardian laser should show or not.
A target must be present. If no target is present the laser will not show and the method will return false.
- 参数:
activated- 激光是否激活- 返回:
- 如果激光已激活则返回 true,否则返回 false
- 另请参阅:
-
hasLaser
boolean hasLaser()获取守卫者的激光是否处于激活状态。原文:Gets whether the guardian laser is active or not.
- 返回:
- 如果激光处于激活状态则返回 true,否则返回 false
-
getLaserDuration
int getLaserDuration()获取激光攻击持续的时长(以 tick 为单位)。原文:Get the duration (in ticks) that a laser attack takes.
- 返回:
- 激光持续时间(以 tick 为单位)
-
setLaserTicks
void setLaserTicks(int ticks) 设置自守卫者发起激光攻击以来经过的 tick 数。如果设置为getLaserDuration()或更大的值,守卫者将对其目标造成伤害, 且激光攻击将完成。要使此值产生任何效果,守卫者必须有一个活动目标(参见
Mob.setTarget(LivingEntity))并且正在蓄力激光攻击(即hasLaser()返回 true)。客户端可能显示与设置的 tick 数 不同的守卫者激光动画。原文:Set the amount of ticks that have elapsed since this guardian has initiated a laser attack. If set to
getLaserDuration()or greater, the guardian will inflict damage upon its target and the laser attack will complete.For this value to have any effect, the guardian must have an active target (see
Mob.setTarget(LivingEntity)) and be charging a laser attack (wherehasLaser()is true). The client may display a different animation of the guardian laser than the set ticks.- 参数:
ticks- 要设置的 tick 数,必须至少为 -10
-
getLaserTicks
int getLaserTicks()获取自守卫者发起激光攻击以来经过的 tick 数。此值是否有意义取决于守卫者是否有一个活动目标(
Mob.getTarget()) 以及是否正在蓄力激光攻击(hasLaser())。此值在攻击成功后 不会重置,也不会在下一次攻击中使用,并且当守卫者发起新的攻击时将被 重置为最小值。原文:Get the amount of ticks that have elapsed since this guardian has initiated a laser attack.
This value may or may not be significant depending on whether or not the guardian has an active target (
Mob.getTarget()) and is charging a laser attack (hasLaser()). This value is not reset after a successful attack nor used in the next and will be reset to the minimum value when the guardian initiates a new one.- 返回:
- 激光 tick 数,范围从 -10 到
getLaserDuration()
-
isElder
已过时。应检测此实例是否为ElderGuardian(entity instanceof ElderGuardian)检测此守卫者是否为远古守卫者.原文:Check if the Guardian is an elder Guardian
- 返回:
- 此守卫者是否为远古守卫者
-
setElder
已过时。必须生成新的ElderGuardian- 参数:
shouldBeElder- shouldBeElder
-
isMoving
boolean isMoving()检测此守卫者是否正在移动。在移动时,守卫者的尖刺会收起,不会对攻击它的实体造成荆棘伤害。 此外,移动中的守卫者无法攻击其他实体。如果静止不动(即此方法返回
false),则必定会造成荆棘伤害,且守卫者可能发起激光攻击。原文:Check whether or not this guardian is moving.
While moving, the guardian's spikes are retracted and will not inflict thorns damage upon entities that attack it. Additionally, a moving guardian cannot attack another entity. If stationary (i.e. this method returns
false), thorns damage is guaranteed and the guardian may initiate laser attacks.- 返回:
- 如果正在移动则返回 true,如果静止则返回 false
-
ElderGuardian(entity instanceof ElderGuardian)