mojira.dev
MCPE-165492

Health component does not work properly

All methods on the health component:

  • resetToDefaultValue

  • resetToMaxValue

  • resetToMinValue

  • setCurrent

Are not working, example code:

world.events.entityHurt.subscribe(data => {
  data.hurtEntity.getComponent("health").setCurrent(1)
})

Expected result:
It should set the current health of the entity you hit to 1

Observed result:
The health of the entity you hit does not change at all.

Note: only tested on entities, not players.

Comments 0

No comments.

CodeGeek01

(Unassigned)

950902, 946364

Confirmed

Windows

Windows 11, Version 21H2

scripting-api

1.19.60.24 Preview, 1.19.51

Retrieved