接口 Firework
- 所有超级接口:
CommandSender,Entity,Metadatable,Nameable,Permissible,PersistentDataHolder,Projectile,ServerOperator
-
嵌套类概要
从接口继承的嵌套类/接口 org.bukkit.entity.Entity
Entity.Spigot -
方法概要
修饰符和类型方法说明voiddetonate()使烟花尽早爆炸, 像是它的引火线已燃烧殆尽.获取此烟花火箭附着的LivingEntity.获取烟花火箭元数据的副本.intgetLife()获取此烟花火箭已存活的 tick 数.int获取此烟花火箭在引爆前存在的时间 (以 tick 为单位).boolean检查此烟花是否已经引爆.boolean获取此烟花是否以一定角度发射 (比如使用弩).booleansetAttachedTo(@Nullable LivingEntity entity) 设置此烟花火箭附着的LivingEntity.void为此烟花火箭应用提供的烟花火箭元数据.booleansetLife(int ticks) 设置此烟花火箭已存活的 tick 数.booleansetMaxLife(int ticks) 设置此烟花火箭在引爆前存在的时间 (以 tick 为单位).voidsetShotAtAngle(boolean shotAtAngle) 设置此烟花是否以一定角度发射 (比如使用弩).从接口继承的方法 org.bukkit.command.CommandSender
getName, sendMessage, sendMessage, sendMessage, sendMessage从接口继承的方法 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.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.entity.Projectile
doesBounce, getShooter, setBounce, setShooter从接口继承的方法 org.bukkit.permissions.ServerOperator
isOp, setOp
-
方法详细资料
-
getFireworkMeta
获取烟花火箭元数据的副本.原文:Get a copy of the fireworks meta
- 返回:
- 烟花火箭元数据的副本
-
setFireworkMeta
为此烟花火箭应用提供的烟花火箭元数据.原文:Apply the provided meta to the fireworks
- 参数:
meta- 要应用的 FireworkMeta
-
setAttachedTo
设置此烟花火箭附着的LivingEntity.当附着到实体时, 烟花效果将正常作用但保持在实体位置. 如果实体
LivingEntity#isGliding() 正在滑翔, 则实体将获得朝向其视线方向的推进力.原文:Set the
LivingEntityto which this firework is attached.When attached to an entity, the firework effect will act as normal but remain positioned on the entity. If the entity
LivingEntity#isGliding() is gliding, then the entity will receive a boost in the direction that they are looking.- 参数:
entity- 烟花应附着的实体, 或 null 以移除附着的实体- 返回:
- 如果实体可以附着则为 true, 如果烟花已经引爆则为 false
-
getAttachedTo
获取此烟花火箭附着的LivingEntity.当附着到实体时, 烟花效果将正常作用但保持在实体位置. 如果实体
LivingEntity#isGliding() 正在滑翔, 则实体将获得朝向其视线方向的推进力.原文:Get the
LivingEntityto which this firework is attached.When attached to an entity, the firework effect will act as normal but remain positioned on the entity. If the entity
LivingEntity#isGliding() is gliding, then the entity will receive a boost in the direction that they are looking.- 返回:
- 附着的实体, 如果没有则为 null
-
setLife
boolean setLife(int ticks) 设置此烟花火箭已存活的 tick 数. 如果此值超过getMaxLife(), 烟花将引爆.原文:Set the ticks that this firework has been alive. If this value exceeds
getMaxLife(), the firework will detonate.- 参数:
ticks- 要设置的 tick 数. 必须大于或等于 0- 返回:
- 如果设置成功则为 true, 如果烟花已经引爆则为 false
-
getLife
int getLife()获取此烟花火箭已存活的 tick 数. 当此值达到getMaxLife()时, 烟花将引爆.原文:Get the ticks that this firework has been alive. When this value reaches
getMaxLife(), the firework will detonate.- 返回:
- 存活 tick 数
-
setMaxLife
boolean setMaxLife(int ticks) 设置此烟花火箭在引爆前存在的时间 (以 tick 为单位).原文:Set the time in ticks this firework will exist until it is detonated.
- 参数:
ticks- 要设置的 tick 数. 必须大于 0- 返回:
- 如果设置成功则为 true, 如果烟花已经引爆则为 false
-
getMaxLife
int getMaxLife()获取此烟花火箭在引爆前存在的时间 (以 tick 为单位).原文:Get the time in ticks this firework will exist until it is detonated.
- 返回:
- 最大存活时间 (以 tick 为单位)
-
detonate
void detonate()使烟花尽早爆炸, 像是它的引火线已燃烧殆尽.原文:Cause this firework to explode at earliest opportunity, as if it has no remaining fuse.
-
isDetonated
boolean isDetonated()检查此烟花是否已经引爆.原文:Check whether or not this firework has detonated.
- 返回:
- 如果已引爆则为 true, 如果仍在世界中则为 false
-
isShotAtAngle
boolean isShotAtAngle()获取此烟花是否以一定角度发射 (比如使用弩). 若此值为false, 烟花将以垂直向上的方向飞行.原文:Gets if the firework was shot at an angle (i.e. from a crossbow). A firework which was not shot at an angle will fly straight upwards.
- 返回:
- 此烟花是否以一定角度发射
-
setShotAtAngle
void setShotAtAngle(boolean shotAtAngle) 设置此烟花是否以一定角度发射 (比如使用弩). 若设置此值为false, 烟花将以垂直向上的方向飞行.原文:Sets if the firework was shot at an angle (i.e. from a crossbow). A firework which was not shot at an angle will fly straight upwards.
- 参数:
shotAtAngle- 此烟花是否以一定角度发射
-