Bug Verified

Switch case, cases break when including the word case inside of the inline metaskill

#6820 opened by Unknown 8 months ago

Unknownreported this bug

Summary

When adding the word case inside an inline switch mechanic, it breaks.

Steps to reproduce

  Material: STICK
  Skills:
  - switch{condition=entitytype{t=<case>};cases=
        case WITHER_SKELETON=[
          - message{m="A SKELETON JUST HIT ME"} @self
          ]
        case HUSK=[
          - message{m="A HUSK JUST HIT ME!"} @self
          ]
        case PIG=[
          - message{m="NOOO A PIG"} @self
          ]
        case DEFAULT=[
          - message{m="case breaks this"} @self 
          ]
      } @trigger ~oninteract

this item can be used to check entity types, but the default is broken because of the word case Current behavior

you can not use case in an inline case mechanic

Intended correct behavior

it should check only for the word case outside of inline mechanics

Debug log snippet

https://pastebin.com/WrnVvbkT while clicking a cow (supposedly triggering the default)

Proposed fixes

More specific checking in the switch case mechanic

Sign in to join the discussion.