#Custom block interaction
13 messages · Page 1 of 1 (latest)
Setting a player on fire when a thing is in inventory is something I've done previously
(for 1.20.1 though)
ok so that didnt work wthis is what i tryed ```PlayerEvents.tick(event => {
const { player, level } = event
const damageSources = level.damageSources()
// run once per second
if (player.age % 20 != 0) return;
const hotItems = [
"cobinc_addons:molten_block_of_iron",
"cobinc_addons:molten_ingot"
]
/**
- checks if player has item anywhere (hands or inventory)
*/
const playerHasHotItem = hotItems.some(id =>
player.inventory.asContainer().hasAnyMatching(item => item.id == id)
)
if (playerHasHotItem) {
player.remainingFireTicks = 21
player.attack(damageSources.onFire(), 2)
}
})```
that didnt work no erros tho
No errors, as in no /kubejs errors, or no errors in game log?
Never trust /kubejs errors for scripts that run after the initial load - /kubejs errors only catch errors that happen during initial script load
yeh it woild be the /kubejs errors would i be better to check the log?
also could nto for the life of em get the lychee working?
Yes - better check your game log (or latest.log)