forked from JaylyDev/ScriptAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
23 lines (23 loc) · 752 Bytes
/
index.js
File metadata and controls
23 lines (23 loc) · 752 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Script example for ScriptAPI
// Author: Jayly <https://github.com/JaylyDev>
// Project: https://github.com/JaylyDev/ScriptAPI
import * as mc from "@minecraft/server";
import { getGamemode } from "get-gamemode/index";
export default function Player(player) {
return Object.assign({
getGameMode() {
return getGamemode(player);
},
kick(reason) {
player.runCommand(`kick "${player.name}" ${reason}`);
},
getScore(objectiveId) {
return mc.world.scoreboard
.getObjective(objectiveId)
.getScore(player.scoreboardIdentity);
},
showForm(form, callback) {
form.show(player).then(callback);
},
}, player);
}