Started by
iYurY
on
Topic category: Help with Minecraft modding (Java Edition)
Hi, sorry for bad english, im from south america
I want to recreate the Netherite armor, that includes the Health Boost, but i have problem, i dont know how to make that the effect apply one time.
im not expert at creating with Mcreator, but i know that using the global trigger "on player tick update" will make that the effect apply every tick, turning the health back to 10, making imposible to regenerate the "extra hearts" that the Health Boost give you
Pls help :/
You can make a procedure that instead of giving the effect every ticks its give you the effect every 2 secondes for exemple. The procedure should be like that i think:
if entity have status effect health_boost then
...
else
give entity status effects health_boost for 2 sec(write the equivalence in minecraft ticks)
--------------------------------------------------------------------------------------------
Sorry if im not clear, i hope you understand my answer
Create a timer using nbt tag on the same player tick update procedure, make as so IF time > determined value DO add potion effect for determined value + and set time to 0.
Sorry i still dont understand, i guess a Photo can help me :D
Global variable(Not for multiplayer):TicksLeft
default=0 type=number
when armor tick(head,chestplate,boots or leggings):
if TicksLeft = 0:
then TicksLeft=SomeValue
give player effect(health boost for time SomeValue+1)
PS:+1 is used to prevent the player lose effect and health=10 and then give it will keep heart in 10 so...
when armor is off:
check player armor slot
if none of them was the type of armor:
then TicksLeft=0
remove the effect(using procedure execute_command_as_entity(/effect clear @s id_got_by_autocomplete_in_minecraft) or just clear_effect)