Hello, just reposting my issue cause I still haven't gotten advice other than changing the value in the let random chain.
Here is the code I am working with in the current 1.20.1 version of Kube, I have base, additions, utils, and packages.
BlockEvents.rightClicked(event => {
if (event.hand != "MAIN_HAND") return
if (event.item.isEmpty() || !event.item.hasTag("forge:shears")) return
if (!event.block.hasTag("tardis:roundel_tab")) return
if (!event.player.isShiftKeyDown()) return
let loot = [
"minecraft:redstone",
"tardis:xion",
"ae2:fluix_crystal",
"mekanism:basic_control_circuit",
]
let random = Math.floor(Math.random() * 1 * loot.length)
let chosen = loot[random] ? loot[random] : "minecraft:charcoal" let dropItem = Item.of(chosen)
event.block.popItemFromFace(dropItem, event.facing)
event.player.damageHeldItem(5)
event.player.swing() })
the main problem is that Kube is not giving me any actionable errors, it just says
"reload failed; keeping old data"
"Reloaded with no KubeJS errors!"
it feels like i heav read those dang messages hundreds of times at this point.
I have included the server script log but I am not sure how it would help.