for whatever reason the script only works if the torch is up right and isnt facing any direction on the side of a block
BlockEvents.rightClicked('hardcore_torches:unlit_torch', e=> {
const failChance = 0.7;
const fireStarter = 'kubejs:fire_plough';
const {player, block, item, hand} = e;
const {properties} = block;
if(hand == 'OFF_HAND' || item != fireStarter) return;
const {x, y, z} = block;
if(Math.random() > failChance) {
player.swing();
player.server.runCommandSilent(`playsound entity.blaze.shoot player @p ${x} ${y} ${z}`);
block.set('hardcore_torches:lit_torch'), {facing: properties.get('facing')};
player.damageHeldItem();
}
else {
player.level.spawnParticles('minecraft:large_smoke', true, x+0.5, y, z+0.5, 0, 0.25, 0, 3, 0.1)
player.server.runCommandSilent(`playsound block.fire.extinguish player @p ${x} ${y} ${z}`);
player.damageHeldItem();
}
})