Add gamemode SC task
This commit is contained in:
parent
2a6a3b5e47
commit
e6aaab63f4
1 changed files with 16 additions and 0 deletions
16
plugins/sc_gamemode.js
Executable file
16
plugins/sc_gamemode.js
Executable file
|
@ -0,0 +1,16 @@
|
|||
|
||||
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
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue