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

Started by DanilkaD on Sun, 02/14/2021 - 10:16

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:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Deal damage to player every 600 ticks while custom effect is active
Sun, 02/14/2021 - 10:16

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:
  • Tracker tickets:
  • 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 20:21, 5. Feb 2022
Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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:
  • Tracker tickets:
  • 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.