how to make player take damage in water

Started by Zardian on Sun, 02/14/2021 - 19:08

Topic category: Help with modding (Java Edition)

Last seen on 22:36, 27. Apr 2021
Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
how to make player take damage in water
Sun, 02/14/2021 - 19:08

I've searched for a while now and I still don't know-how

Last seen on 13:29, 13. Feb 2022
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
procedure damage_in_water:…
Sat, 03/20/2021 - 11:48

procedure damage_in_water:

On player tick:

if block at (x) (y) (z) is (WATER):

>deal damage to entity (entity) amount:[choose here] type:[choose a type here]

else if block at (x) (y) (z) is F(LOWING_WATER):

>deal damage to entity (entity) amount:[choose here] type:[choose a type here]

comment:if you want to deal damage if only head is in water add everything below otherwise don't

else:

comment:if you want to deal double damage if both feet and head is in water remove the "else"(but not "execute procedure)

>execute procedure (damage_in_water_2) at (x) (y+1) (z)

comment:copy prcedure as damage_in_water_2 and remove the "execute procedure" and "else" statements

Last seen on 13:29, 13. Feb 2022
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
EDIT:damage_in_water_2…
Sat, 03/20/2021 - 11:49

EDIT:damage_in_water_2 should have NO TRIGGERS(change "on player tick" to "no additional triggers")