Deal damage to player every 600 ticks while custom effect is active

Started by DanilkaD on

Topic category: Help with modding (Java Edition)

Last seen on 14:22, 1. Jan 2022
Joined Feb 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Deal damage to player every 600 ticks while custom effect is active

Literally what the title says. I need to make an "intoxication" effect but I want the effect to deal damage every 600 ticks (30 seconds) while the effect is active. When the effect runs out, it will not deal damage anymore

Last seen on 19:15, 17. Mar 2021
Joined Feb 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Well i would do something…
Wed, 02/17/2021 - 19:07

Well i would do something that says 3 percent of the time (theres a templete for % of time in templete area), give targe 1 geniune damage.

Last seen on 03:52, 31. Dec 2022
Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Have an nbt tag attached to…
Fri, 02/19/2021 - 18:01

Have an nbt tag attached to the player that increases on the player tick update, then check if that nbt tag is greater than or equal to 600. If it is, deal damage and reset it to zero.

Last seen on 14:22, 1. Jan 2022
Joined Feb 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
So, to do it I needed some…
Tue, 02/23/2021 - 14:53

So, to do it I needed some Java coding, so I edited with some of the code from the effect and it works. But the response above is very interesting and I recommend it for people who don't know Java coding, like me.

Last seen on 16:44, 2. Mar 2024
Joined Aug 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Like, how? Because i've been…
Sun, 08/28/2022 - 16:25

Like, how?

Because i've been searching on how to do this thing for 1 day straight and i still can't figure out the code.