Auxilor / EcoArmor

Custom armor sets plugin for the latest minecraft version
GNU General Public License v3.0
31 stars 27 forks source link

Conditions do not re-check their values over time #30

Closed OmegaWulf closed 2 years ago

OmegaWulf commented 2 years ago

Describe the bug Conditions like standing on block only checks one time when the armor is put on.

For example standing on block will only activate if you're standing on the block and put on the armor. If you walk off the target block and then back on, the effect will never fire again.

To Reproduce Steps to reproduce the behavior:

  1. Add the following effect to an armor set:
      - id: add_stat
        args:
          stat: speed
          amount: 22
        conditions:
          - id: standing_on_block
            args:
              block: stone
  2. Stand on stone and put on the armor. You will gain 22 speed.
  3. Walk off the stone block and then walk back onto it. You never gain the 22 speed again.

Expected behavior I expect the conditions to periodically check their values over time. This should probably be configurable for performance reasons.

For example, an argument on a condition: refresh

This argument takes either seconds or ticks and will re-check the condition over and over again.

Server Information (please complete the following information):

OmegaWulf commented 2 years ago

Also the refresh value could be useful as an improvement as well.

Currently if you put on the armor while standing on stone and then jump, you lose the speed buff right away.

With a refresh option, it could be configured to only check every 3 seconds. This way players can jump without losing the effect.

WillFP commented 2 years ago

it automatically checks several times a second; the conditions are checked over and over again

OmegaWulf commented 2 years ago

@WillFP Can you double check with something like this:

      - id: add_stat
        args:
          stat: speed
          amount: 22
        conditions:
          - id: standing_on_block
            args:
              block: stone

For me, it doesn't seem to ever add the bonus back. I only get the buff if I put on the armor while standing on the block. Even if I jump, I permanently lose the buff and don't get it back until I put on an armor piece again.

WillFP commented 2 years ago

Fixed!