Skip to main content

Await (Sleep / Until)

Examples:

MCFunction('explosive', () => {
say('explod in 5')
for (let i = 4; i != 0; i--) {
_.await.sleep('1s')
say(`${i}`)
}
kill('herobrine')
})

MCFunction('explod_me', () => {
say('explod in 5')
for (let i = 4; i != 0; i--) {
_.await.sleep('1s')
say(`${i}`)
}
kill('@s')
}, {
asyncContext: true
})
MCFunction('jump', () => {
say('you should jump!')
_.await.until(_.predicate(Predicate('jumping', {
type: "minecraft:entity_properties",
entity: "this",
predicate: {
"minecraft:type_specific/player": {
input: {
jump: true
}
}
}
})), '1t')
give('@s', 'diamond', 1)
}, {
asyncContext: true
})