owobot/plugins/sc_gamemode.js

17 lines
426 B
JavaScript
Raw Normal View History

2024-07-17 11:41:18 -04:00
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
}
})
}
}