Carpet

Carpet

2M Downloads

Scarpet: In `modify(e, 'effect')`, if the `ambient` parameter is specified, it overrides the `showIcon` parameter value.

James103 opened this issue ยท 0 comments

commented

To reproduce, run this command: script run modify(p, 'effect', 'speed', 1000, 1, false, false, true)
Breakdown of parameters in function modify(p, 'effect'):

  • entity is p
  • action is effect
  • effect name is speed
  • effect duration is 1000
  • effect amplifier is 1
  • effect show_particles is false
  • effect show_icon is false
  • effect ambient is true, but that does not apply correctly, instead setting the show_icon flag.

Therefore, if the ambient parameter is specified, it overrides the show_icon parameter instead of the expected behavior.

As a workaround, run this command: script run modify(p, 'effect', 'speed', 1000, 1, false, false)
Breakdown:

  • Same as above
  • effect ambient parameter is not specified and defaults to false, allowing the show_icon parameter to work as intended.

Caused by:

boolean ambient = false;
if (lv.size() > 5)
showIcon = lv.get(5).getBoolean();
le.addEffect(new MobEffectInstance(effect, duration, amplifier, ambient, showParticles, showIcon));