owobot/plugins/sc_gamemode.js
2024-07-28 02:37:31 -04:00

15 lines
378 B
JavaScript
Executable file

module.exports = {
load: () => {
},
loadBot: (b) => {
b.add_sc_task('gamemode', '/minecraft:gamemode creative', true)
b._client.on('game_state_change', (p) => {
if (p.reason === 3 && p.gameMode !== 1) {
b.sc_tasks.gamemode.failed = 1
} else if (p.reason === 3 && p.gameMode === 1) {
b.sc_tasks.gamemode.failed = 0
}
})
}
}