Tried to make an item as a one-use flint and steel for campfires- Much saddeningly, it has been a very harsh struggle. Campfire will not light up.
if (!event.player.isHolding('kubejs:firestarter')) return
event.player.tell('Firestarter is held while clicking on a campfire')
if (event.getBlock().getProperties().get('lit') == 'false') return
event.player.tell('Firestarter has observed that the campfire is not lit') // Will not go past this point
event.block.set( event.block, event.block.getProperties().set('lit', 'true') )
event.player.tell('Firestarter has lit the campfire')
event.block.playSound('minecraft:item.flintandsteel.use')
event.player.tell('Firestarter has played a sound effect')
if(event.player.isCreative()) {event.player.mainHandItem.count--}
event.player.tell('Firestarter is gone from the player inventory')
event.cancel()
})```