org.bukkit.potion想写中毒效果,在文档里只看得出持续时间与药水等级,不知道是否能定义伤害
复制代码如果大佬能解释一下另外几个参数的含义就更好了。
- public PotionEffect(PotionEffectType type,
- int duration,
- int amplifier,
- boolean ambient,
- boolean particles,
- Color color)
- Creates a potion effect.
- 参数:
- type - effect type
- duration - measured in ticks, see getDuration()
- amplifier - the amplifier, see getAmplifier()
- ambient - the ambient status, see isAmbient()
- particles - the particle status, see hasParticles()
- color - the particle color, see getColor()
自定义中毒效果的伤害的话,可以监听org.bukkit.event.entity.EntityDamageEvent然后getCause(),判断是否为POISON,然后再获取实体相关的信息,自定义伤害setDamage(double damage)。
至于那几个参数没怎么注意过,我觉得比较重要的就是amplifier是指倍率,即等级-1
至于那几个参数没怎么注意过,我觉得比较重要的就是amplifier是指倍率,即等级-1
本帖最后由 teddyxlandlee 于 2022-12-20 12:13 编辑
XStar_FlameX 发表于 2022-12-20 07:38
嗯,我果然看不懂
|