Trying a KubeJS compatibility with Natural Progression (1.18.2)
emanuele246gi opened this issue ยท 0 comments
Hi, I am trying to create a compatibility between Natural Progression and First Aid by using KubeJS, I want it to be the arm that gets hurt, instead of a general hit to the whole body, when you take damage while digging with your bare hands (the Natural Progression feature already present by default). This is the code I put, but it doesn't work, sorry but I am not an expert in the field, I am "new":
onEvent('player.tick', event => {
let player = event.player
if (player.getMainHandItem().isEmpty() && player.isBreakingBlock()) {
player.attack(1)
player.getPersistentData().firstaid_bodyPart = "arm"
}
})