KubeJS (Old)

KubeJS (Old)

3M Downloads

All Detector blocks run all Detector scripts

aaronhowser1 opened this issue ยท 2 comments

commented

Minecraft Version

1.19.2

KubeJS Version

kubejs-forge-1902.6.0-build.135

Rhino Version

rhino-forge-1902.2.2-build.268

Architectury Version

architectury-6.5.77-forge

Forge/Fabric Version

Forge 43.2.8

Describe your issue

Startup:

StartupEvents.registry('block', (block) => {
    block.create('leave_school', 'detector').detectorId('leave_school')
    block.create('luminizer_1', 'detector').detectorId('luminizer_1')
})

Server:

BlockEvents.detectorPowered('leave_school', (event) => {
    let nearbyPlayers = event.block.playersInRadius

    for (let player of nearbyPlayers) player.runCommand('/school leave')
})

BlockEvents.detectorPowered('luminizer_1', (event) => {

    const thisBlock = event.block
    const here = event.block.position

    thisBlock.set('botania:light_relay')
    thisBlock.entityData = {
        bindX: here.x + 1,
        bindY: here.y + 1,
        bindZ: here.z + 2,
    }
})

Both detectors, when powered by redstone, turn themselves into a Luminizer, and also run the command /school leave.

Crash report/logs

No response

commented

Is a release with this fix out?

commented

Yes