-
Notifications
You must be signed in to change notification settings - Fork 5
/
SkyPlay.js
24 lines (22 loc) · 1.03 KB
/
SkyPlay.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
///api_version=2
(script = registerScript({
name: "SkyPlay",
version: "1.4",
authors: ["CzechHek"]
})).import("Core.lib");
module = {
onUpdate: function () {
if (config && !!mc.getCurrentServerData() && mc.getCurrentServerData().serverIP.match("skykingdoms.net")) commandManager.executeCommand(".config load https://pastebin.com/raw/3kXNxBYV"), config = false;
if (mc.thePlayer.getActivePotionEffect(Java.type("net.minecraft.potion.Potion").invisibility) && leave) mc.thePlayer.sendChatMessage("/sw leave"), leave = false;
},
onPacket: function (event) {
if ((packet = event.getPacket()) instanceof S02PacketChat && packet.getChatComponent().getUnformattedText().match("Congratulations! you have won the game!")) mc.thePlayer.sendChatMessage("/sw leave"), leave = false;
},
onWorld: function () {
if (!leave) mc.thePlayer.sendChatMessage("/sw autojoin"), leave = true;
},
onLoad: function () {
SkyPlayModule.state = true;
}
}
leave = config = true;