Hello
I wanted to ask if it was possible to reduce this code, instead of putting in each condition the level number, like what is shown here.
to put as in a single condition that detects depending on the level in number .
making it increase for example the chance
if level 1 :
the chance was 5%.
in the following levels it would start to increase by 5%.
I wanted to ask if it was possible to reduce this code, instead of putting in each condition the level number, like what is shown here.
to put as in a single condition that detects depending on the level in number .
making it increase for example the chance
if level 1 :
the chance was 5%.
in the following levels it would start to increase by 5%.
Code:
on damage:
attacker is entity
victim is entity
if "%lore of victim's tool%" contains "Reflex 1":
chance of 5%
send action bar "&bReflexed" to victim
push victim backwards at speed 1
play sound "entity.player.attack.sweep" with volume 1 and pitch 1.5 at victim
cancel event
if "%lore of victim's tool%" contains "Reflex 2":
chance of 10%
send action bar "&bReflexed" to victim
push victim backwards at speed 1
play sound "entity.player.attack.sweep" with volume 1 and pitch 1.5 at victim
cancel event
if "%lore of victim's tool%" contains "Reflex 3":
chance of 15%
send action bar "&bReflexed" to victim
push victim backwards at speed 1
play sound "entity.player.attack.sweep" with volume 1 and pitch 1.5 at victim
cancel event