#Custom block interaction

13 messages · Page 1 of 1 (latest)

smoky bayBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

brazen sonnet
#

The first can probably be done with lychee

storm sapphire
#

Setting a player on fire when a thing is in inventory is something I've done previously

#

(for 1.20.1 though)

twilit jackal
#

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

storm sapphire
#

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

twilit jackal
#

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?

storm sapphire