Bad Syntax Bug: Has potion effect condition not working correctly

Discussion in 'Bug Reports' started by xlsalvolx, Jan 20, 2020.

  1. xlsalvolx

    xlsalvolx Member
    Premium Supporter Supporter Contest Winner

    Joined:
    Jan 9, 2017
    Messages:
    110
    Likes Received:
    12
    Enter a brief description of what is broken Has potion effect condition not working correctly

    What version of Minecraft are you using?
    1.13 R2

    What server jar are you using? paperclip

    What is this a bug report for? MythicMobs

    What version of the plugin are you using? dev build #3170

    Describe the bug. Be as specific as possible, images or short gifs/videos are welcome but save configuration files for later sections. Write a whole paragraph if needed, help us bug testers replicate your issue!
    Has potion effect condition has stopped working correctly in recent dev builds (not sure which one)

    Example Configurations
    Code:
    testitem:
      Id: wooden_sword
      Data: 0
      Display: '&f&lTest item'
      Enchantments:
      - PROTECTION_ENVIRONMENTAL:1
      Skills:
      - skill{s=testskill} ~onUse
    
    testskill:
      Cooldown: 1
      Conditions:
      - haspotioneffect{type=ABSORPTION;level=0;duration=>0} false
      - haspotioneffect{type=DAMAGE_RESISTANCE;level=0;duration=>0} false
      - haspotioneffect{type=FIRE_RESISTANCE;level=0;duration=>0} false
      - haspotioneffect{type=FAST_DIGGING;level=0;duration=>0} false
      - haspotioneffect{type=HEAL;level=0;duration=>0} false
      - haspotioneffect{type=INCREASE_DAMAGE;level=0;duration=>0} false
      - haspotioneffect{type=INVISIBILITY;level=0;duration=>0} false
      - haspotioneffect{type=REGENERATION;level=0;duration=>0} false
      - haspotioneffect{type=SATURATION;level=0;duration=>0} false
      - haspotioneffect{type=SPEED;level=0;duration=>0} false
      - haspotioneffect{type=LUCK;level=0;duration=>0} false
      - haspotioneffect{type=NIGHT_VISION;level=0;duration=>0} false
      - haspotioneffect{type=WATER_BREATHING;level=0;duration=>0} false
      Skills:
      - effect:sound{s=entity.player.levelup;v=1;p=0.1} @self
      - damage{a=2;i=false} @self
    Console log with mm debug 4:
    Code:
    [16:33:08 INFO]: [MythicMobs] |----- ? Checking SkillTrigger USE == USE
    [16:33:08 INFO]: [MythicMobs] |----- + SkillMechanic usable!
    [16:33:08 INFO]: [MythicMobs] |----- Executing SkillMechanic with power 1 (line: skill{s=testskill} ~onUse)
    [16:33:08 INFO]: [MythicMobs] |------- : SkillMechanic is a META mechanic. Executing...
    [16:33:08 INFO]: [MythicMobs] Checking if target has PotionEffect type = ABSORPTION, level = RangedDouble{0.0 to 0.0}, d = RangedDouble{0.0 to 1.7976931348623157E308}
    [16:33:08 INFO]: [MythicMobs] Returning true
    [16:33:08 INFO]: [MythicMobs] |----- ! Skill not usable: Conditions failed.
    I am, of course, not using any potion effects, but the skill is returning true nonetheless.
     
    #1
  2. jaylawl

    jaylawl Developer
    Developer Community Manager Premium Supporter Supporter Quality Assurance

    Joined:
    Sep 16, 2015
    Messages:
    1,840
    Likes Received:
    175
    Code:
    - haspotioneffect{type=ABSORPTION;level=0;duration=>0} FALSE
    This is a negated condition, meaning that you were asking "does it NOT have this potion effect?", to which it correctly replies "true"
     
    #2
  3. xlsalvolx

    xlsalvolx Member
    Premium Supporter Supporter Contest Winner

    Joined:
    Jan 9, 2017
    Messages:
    110
    Likes Received:
    12
    Yeah, the thing is, it used to work correctly doing it the opposite way... Oh well, the important thing is i know how to fix my stuff lol thanks
     
    #3
    jaylawl likes this.

Share This Page