Magic

Magic

190k Downloads

[BUG] Variables not working on Selector action

shareacoke opened this issue · 5 comments

commented

Hi, I have recently upgraded the magic plugin from an older version and, as expected, some spells needed some fixing and most of them are okay, but I think I found a common error on my config when reloading that I don't understand why it worked before, but now it does not.

I used to have several selectors inherit from one that acts as a base for the rest, so I just have to change a few slots in parameters section in the inherit ones, and they will be good to go. I made a simpler example - which may not have sense in a minecraft server, it's just made up, so you can see the behavior I am talking about.

missile_menu:
  icon: book
  actions:
    cast:
    - class: Selector
      options:
      - cast_spell: $opt
        name: $opt_name
        slot: 4
        cost: 1
  parameters:
    target: self
    title: Cast a Missile
    opt_name: "&3Do you want to cast a missile?"
    opt: missile

heal_menu:
  inherit: missile_menu
  parameters:
    title: Cast a healing speel
    opt_name: "&3Do you wan to cast a healing speel?"
    opt: heal

Those spells work on older versions (in this example version 8.7.1).

selector with variables version 8

But they do not work on 10.8.3

selector with variables version 10

Is it a bug? Or was that discontinued for a reason? It could be intentional like if it was not working for different game versions or so. If it was not a wanted/intentional change/feature, could it come back?

Also, thank you in advance.

commented

I do recall making some changes to how this parameterization stuff works... I think what you're seeing is a bug, I doubt it was an intentional change but it may have gotten dropped accidentally.

I will look into it when I can, my hope is it's something I can bring back easily.

commented

I have found where this got dropped and will have it back in for the next dev build and release. Apologies!

commented

Oh! Thank you!! Thank you very much!!!!

I am sorry, but I think I found another issue with the $ variables. (I don't know if the fix you added today will repair this, so I will tell you the issue just in case).

It is kind of strange because when I reload the plugin, there is no error message - it only pops up on the console when casting a spell with the $ in the potency of a Potion Effect Action. So that's why I didn't find it sooner.

The error I get while casting it is:
[WARN]: Error parsing potion effect for PotionEffectType[2, SLOW]: $potency

I just hope this is also fixable as the selector one.

As always thank you in advance for helping me. Your plugin is such an amazing one and it has too many things so I get why some things can get behind in the way!! Thanks!

commented

The bug and fix were not specific to selectors, but the $ parameters in general.

Please let me know if you continue to see these problems on 10.8.4

commented

Oh, my bad! I didn't see that you had upgraded the plugin just a few hours ago.

I have checked it and all the errors from the selector and potion effect action are gone. Thank you very much! ❤️