#Respawn hurt and hungry

21 messages · Page 1 of 1 (latest)

light meteor
#

I want to make death less forgiving by not making players respawn with full health and hunger, so that they'll have to invest some time and food to recover, instead of using suicide to save on food or return into fights with full health.

Is it possible to make so that after death the players respawn hurt and without a refilled hunger bar? Half for both for example.

If it's possible, could you guide me on how to make it happen?

novel crescentBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

delicate wraith
#

I'm not sure how but maybe an event on respawn to deal damage to health and hunger?

light meteor
half wharf
#

you want the player respawned event

PlayerEvents.respawned(event => {
  const {player, keepData} = event
  // jumping in end portal is also a 'respawned event'
  if (keepData) return
  // the rest of the owl here
})
open summit
half wharf
#

sank you

open summit
#

fixed uwu

light meteor
#

How do I draw the rest of the fruity owl?

half wharf
#

someone finally comments on my use of 'the rest of the owl'..... yay

light meteor
#

Lol

half wharf
#

well from there you could do stuff like

PlayerEvents.respawned(event => {
  const {player, keepData} = event
  // jumping in end portal is also a 'respawned event'
  if (keepData) return
  player.setFoodLevel(some #)
  player.setSaturation(some #)
  player.setHealth(some #.#)
})
light meteor
#

I see, thanks

#

Is there a page on the documentation that contains the player.stuff?

half wharf
#

it's a mix of vanilla methods on player and livingEntity, plus kjs' wrapper on those two heh

#

the forge javadocs aren't always helpful for you on fabric, but it does include stuff that's vanilla and not forge

half wharf
#

half of doing cool stuff in kjs is just learning where to look

light meteor
#

It seems to be working well, thanks