This repository was archived by the owner on Dec 24, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathworldCode.js
More file actions
780 lines (773 loc) · 21.9 KB
/
worldCode.js
File metadata and controls
780 lines (773 loc) · 21.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
TTimers = {};
var tips = ["You can deposit coins into your bank by holding a gold coin that has a name of the amount you want to deposit and clicking.", "You can withdraw coins from your bank by using !withdraw (amount).", "You can sell items by going into the \"Sell Warp\".", "You can level up by mining a stone generator.", "You can go to your island faster by using the command \"!island\".", "If your messy stone generator isn't working, just replace the water / lava.","You can make your stone generator by placing water, and lava 1 block apart and breaking the block in between them.","If there are any bugs, please report them to BloxdMasterYT_LT5 on discord."];
{
var lastTime = Math.floor(Date.now()/100000);
const k = (c) => api.broadcastMessage(c, { color: "#ff9d87" }),
s = TTimers;
let m = 1,
l = 0,
f = 0,
T = 0,
o = 1 / 0,
a;
(setTickTimeout = (c, i = 0) => {
const e = m++,
t = l + i;
if (
((s[e] = [c, t, T, 0]),
T ? (s[T][3] = e) : (f = e),
(T = e),
t < o && (o = t),
(a = !0),
!i)
) {
try {
c();
} catch (r) {
k("TTI: " + r);
}
clearTickTimeout(e);
}
return e;
}),
(clearTickInterval = clearTickTimeout =
(c) => {
const i = s[c];
if (i) {
const e = i[2],
t = i[3];
e ? (s[e][3] = t) : (f = t), t ? (s[t][2] = e) : (T = e), delete s[c];
}
}),
(setTickInterval = (c, i) => {
const e = setTickTimeout(c, (i ||= 1));
return (s[e][4] = i), e;
}),
(tick = (c, i) => {
if(lastTime!=Math.floor(Date.now()/100000)){
lastTime=Math.floor(Date.now()/100000);
api.broadcastMessage(
"Tip: "+tips[Math.floor(Math.random() * tips.length)],
{ color: "#af3c23ff" }
);
}
if (i || ++l >= o) {
a = !1;
let e = 1 / 0,
t = f;
for (; t; ) {
const r = s[t];
if (r[1] <= l) {
try {
r[0]();
} catch (n) {
k("TT: " + n);
}
if (r[4]) {
const n = l + r[4];
(r[1] = n), n < e && (e = n);
} else clearTickTimeout(t);
} else r[1] < e && (e = r[1]);
t = r[3];
}
(o = e), a && tick(1, !0);
}
});
}
function styTxt(l) {
let n = styTxt;
if (
(n.e ||
((n.e = {
c: "color",
w: "fontWeight",
st: "fontStyle",
s: "fontSize",
o: "opacity",
}),
(n.t = /(\\\<)|<(st|[cworis]) *([^>]+)?>/g)),
l == "")
)
return [""];
const r = [],
e = new Map();
let t = "",
c = 0;
for (let { index: f, 0: u, 1: a, 2: o, 3: i } of [
...l.matchAll(n.t),
{ index: l.length },
]) {
if (((t += l.slice(c, f)), (c = f + (u?.length ?? 0)), a)) {
t += "<";
continue;
}
if (
(t &&
(r.push(e.size ? { str: t, style: Object.fromEntries(e) } : t),
(t = "")),
f != l.length)
)
if (o == "r") e.clear();
else if (o == "i" && i) {
const s = Object.fromEntries(e);
delete s.fontStyle, r.push({ icon: i, style: s });
} else {
let s = n.e[o];
i ? e.set(s, o == "o" ? Number(i) : i) : e.delete(s);
}
}
return r;
} /* Props to _frostycaveman (discord) for making setTickTimeout and customized custom text styling!*/
var valuableItems = {
Gold_Antlers: 5500,
Messy_Stone: 20,
Gold_Watermelon_Slice: 300,
Gold_Fragment: 200,
Coal: 245,
Raw_Iron: 650,
Iron_Bar: 750,
Gold_Bar: 1225,
Raw_Gold: 1125,
Diamond: 1350,
Moonstone: 2300,
Maple_Log: 100,
Apple: 120,
Raw_Porkchop: 250,
Cooked_Porkchop: 350,
Golem_Eye: 450,
Raw_Beef: 300,
Cooked_Beef: 400,
Raw_Mutton: 350,
Cooked_Mutton: 450,
Leather: 500,
Raw_Venison: 400,
Cooked_Venison: 500,
Fur: 550,
Knight_Heart: 1000,
Bone_Antlers: 600,
Rice: 25,
Fat_Cactus: 300,
Dry_Fat_Cactus: 250,
Cranberries: 55,
Corn: 60,
Cotton: 65,
Chili_Pepper: 70,
Wheat: 50,
Watermelon: 65,
Watermelon_Slice: 13,
Melon: 75,
Melon_Slice: 15,
Pumpkin: 71,
Grass:5,
Dirt:2,
Maple_Log:40,
Maple_Wood_Planks:8,
};
function onPlayerPickedUpItem(id,name,amt){
if(Object.keys(valuableItems).includes(name.replaceAll(" ","_"))){
for (let i = 0; i < 47; i++) {
let item = api.getItemSlot(id, i);
if (!item) continue;
if (item&&item.name == name&&Object.keys(valuableItems).includes(item.name.replaceAll(" ","_"))) {
api.setItemSlot(id, i, item.name, item.amount, {customDescription: "Sellable"}, true);
break;
}
}
}
}
function onPlayerDamagingOtherPlayer(id, a, b, c, d, e) {
if (
!api.isInsideRect(
api.getPosition(id),
[-344, -331, -471],
[-540, -151, -317],
true
)
) {
return "preventDamage";
}
}
function onPlayerClick(id, g) {
let heldItem = api.getHeldItem(id);
if (!heldItem) {
return;
} else if (
heldItem.name == "Gold Coin" &&
heldItem.attributes.customDisplayName !== undefined
) {
if (heldItem.attributes.customDisplayName <= 0) {
api.sendMessage(id, "You cannot deposit $0 or less!", { color: "red" });
return;
}
if (isNaN(heldItem.attributes.customDisplayName)) {
api.sendMessage(id, "Invalid Gold Coin amount!", { color: "red" });
return;
}
api.setMoonstoneChestItemSlot(id, 0, "Gold Coin", 1, {
customDisplayName: String(
Number(
api.getMoonstoneChestItemSlot(id, 0).attributes.customDisplayName
) + Number(heldItem.attributes.customDisplayName)
),
});
updateUi(id);
api.playSound(id, "cashRegister", 1, 1, { playerIdOrPos: id });
api.removeItemName(id, heldItem.name, 1);
api.sendMessage(
id,
`You deposited $${heldItem.attributes.customDisplayName}!`,
{ color: "green" }
);
}
}
function onPlayerAltAction(id, x, y, z, a, e) {
onPlayerClick(id, true);
}
function onMobDamagingPlayer(a, b, c, d) {
return "preventDamage";
}
function actuallyGeneratingTheIsland(nDN, nDN2) {
setTickTimeout(
() => api.setBlockRect([nDN, -150, 429], [nDN2, -150, 424], "Bedrock"),
0
);
setTickTimeout(
() => api.setBlockRect([nDN, -149, 429], [nDN2, -147, 424], "Dirt"),
1
);
setTickTimeout(
() => api.setBlockRect([nDN, -146, 429], [nDN2, -146, 424], "Grass Block"),
2
);
setTickTimeout(
() => api.setBlockRect([nDN - 3, -150, 426], [nDN2, -146, 424], "Air"),
3
);
}
function sell(id, mode) {
let coins = Number(
api.getMoonstoneChestItemSlot(id, 0).attributes.customDisplayName
);
let heldItem = api.getHeldItem(id);
if (!heldItem) {
api.sendMessage(id, "You're not holding anything!", {
color: "red",
});
return;
}
let itemName = heldItem.name.replaceAll(" ", "_");
if (!valuableItems[itemName]) {
api.sendMessage(id, "This item cannot be sold.", { color: "red" });
return;
}
if (mode === "sell1Same") {
api.setMoonstoneChestItemSlot(id, 0, "Gold Coin", 1, {
customDisplayName: String(coins + valuableItems[itemName]),
});
api.playSound(id, "cashRegister", 1, 1, { playerIdOrPos: id });
api.removeItemName(id, heldItem.name, 1);
api.sendMessage(
id,
`You sold 1 ${itemName} for $${valuableItems[itemName]} Note: The sold item can be from anywhere in your inventory.`,
{ color: "green" }
);
} else if (mode === "sellAllSame") {
let slotIndex = api.getSelectedInventorySlotI(id);
let slotItem = api.getItemSlot(id, slotIndex);
let totalValue = valuableItems[itemName] * slotItem.amount;
api.setMoonstoneChestItemSlot(id, 0, "Gold Coin", 1, {
customDisplayName: String(coins + totalValue),
});
api.playSound(id, "cashRegister", 1, 1, { playerIdOrPos: id });
api.sendMessage(
id,
`You sold all ${itemName}(s) for $${totalValue} Note: The sold item can be from anywhere in your inventory.`,
{ color: "green" }
);
api.setItemSlot(id, slotIndex, "Air", 0, {}, true);
}
updateUi(id);
}
function updateUi(id) {
let xpStuff =
150 * api.getMoonstoneChestItemSlot(id, 2).attributes.customDisplayName;
if (xpStuff > 1650) {
xpStuff = "Max";
}
api.setClientOptions(id, {
RightInfoText: styTxt(
`<w bold><s 20px>✨SkyBloxd🌎🌳\n <w><s><c gray><i wrench><c> Owner - BloxdMasterYT_LT5 \n <c yellow><i coins><c> Coins - $${
api.getMoonstoneChestItemSlot(id, 0).attributes.customDisplayName
}\n <i award> Level - ${
api.getMoonstoneChestItemSlot(id, 2).attributes.customDisplayName
} \n <s 10px>XP: ${
api.getMoonstoneChestItemSlot(id, 3).attributes.customDisplayName
} / ${xpStuff} \nv1.4`
),
});
api.setTargetedPlayerSettingForEveryone(
id,
"lobbyLeaderboardValues",
{
coins: api.getMoonstoneChestItemSlot(id, 0).attributes.customDisplayName,
},
true
);
api.setTargetedPlayerSettingForEveryone(
id,
"nameTagInfo",
{
subtitle: [
{
str:
"$" +
api.getMoonstoneChestItemSlot(id, 0).attributes.customDisplayName,
},
],
subtitleBackgroundColor: "#4BE74F",
},
true
);
}
function shop(id, item, price) {
if (api.inventoryIsFull(id)) {
api.playSound(id, "beep", 1, 1, { playerIdOrPos: id });
api.sendMessage(id, `ur inventory is full lol 💀`, { color: "red" });
return false;
}
let coins = Number(
api.getMoonstoneChestItemSlot(id, 0).attributes.customDisplayName
);
if (coins >= price) {
api.playSound(id, "cashRegister", 1, 1, { playerIdOrPos: id });
api.setMoonstoneChestItemSlot(id, 0, "Gold Coin", 1, {
customDisplayName: String(coins - price),
});
api.giveItem(id, item);
api.sendMessage(id, `You bought ${item} for $${price}`, { color: "green" });
updateUi(id);
} else {
api.playSound(id, "beep", 1, 1, { playerIdOrPos: id });
api.sendMessage(id, `ur too broke lol 💀`, {
color: "red",
});
}
}
function gamble(id, price, min, max) {
let coins = Number(
api.getMoonstoneChestItemSlot(id, 0).attributes.customDisplayName
);
if (coins >= price) {
api.playSound(id, "cashRegister", 1, 1, { playerIdOrPos: id });
api.setMoonstoneChestItemSlot(id, 0, "Gold Coin", 1, {
customDisplayName: String(coins - price),
});
let result = Math.floor(Math.random() * (max - min + 1)) + min;
api.sendMessage(
id,
`You gambled and ${result > 0 ? "won" : "lost"} $${Math.abs(result)}`,
{
color: result > 0 ? "green" : "red",
}
);
api.setMoonstoneChestItemSlot(id, 0, "Gold Coin", 1, {
customDisplayName: String(coins - price + result),
});
updateUi(id);
} else {
api.playSound(id, "beep", 1, 1, { playerIdOrPos: id });
api.sendMessage(id, `ur too broke lol 💀`, {
color: "red",
});
}
}
function generateIsland(id) {
let nDN =
Number(
api.getStandardChestItemSlot([-346, 6, -433], 0).attributes
.customDisplayName
) + 512;
let nDN2 = nDN - 5;
let awoefhd = String(nDN - 1);
api.setMoonstoneChestItemSlot(id, 1, "Dirt", 1, {
customDisplayName: awoefhd,
});
api.setPosition(id, [
Number(api.getMoonstoneChestItemSlot(id, 1).attributes.customDisplayName),
-136,
428,
]);
api.clearInventory(id);
api.giveItem(id, "Water Bucket");
api.giveItem(id, "Lava Bucket");
api.giveItem(id, "Bone Meal");
api.giveItem(id, "Protector");
api.giveItem(id, "Maple Sapling");
try {
setTickTimeout(() => {
actuallyGeneratingTheIsland(nDN, nDN2);
}, 3);
} catch (stupidError) {
api.sendMessage(
id,
"There was an error while generating your island: " +
stupidError +
". Please use !resetEverything and try again.",
{ color: "red" }
);
}
if (api.getBlock(nDN, -150, 429) == "Bedrock") {
api.sendMessage(id, "Island generated successfully!", { color: "green" });
}
api.setStandardChestItemSlot([-346, 6, -433], 0, "Dirt", 1, undefined, {
customDisplayName: awoefhd,
});
api.setPosition(id, [
Number(api.getMoonstoneChestItemSlot(id, 1).attributes.customDisplayName),
-136,
428,
]);
}
function onPlayerJoin(id) {
if (api.getMoonstoneChestItemSlot(id, 0) == null) {
api.setPosition(id, -346.5, 8, -433.5);
api.setMoonstoneChestItemSlot(id, 2, "Messy Stone", 1, {
customDisplayName: "1",
});
api.setMoonstoneChestItemSlot(id, 3, "Messy Stone", 1, {
customDisplayName: "1",
});
api.setMoonstoneChestItemSlot(id, 0, "Gold Coin", 1, {
customDisplayName: "100",
});
api.setClientOptions(id, {
lobbyLeaderboardInfo: {
pfp: {
sortPriority: 1,
},
name: {
displayName: "Name",
sortPriority: 0,
},
coins: {
displayName: "Coins",
sortPriority: 5,
},
},
});
api.sendMessage(
id,
"Welcome " +
api.getEntityName(id) +
" to this skyblock server! \n Use !help to view all avaliable commands.",
{}
);
updateUi(id);
setTickTimeout(() => {
generateIsland(id);
}, 100);
return true;
} else {
api.sendMessage(
id,
"Welcome back " +
api.getEntityName(id) +
"! \n Use !help to see all avaliable commands",
{}
);
updateUi(id);
}
}
var resetConfirm = false;
var nDN;
function onPlayerChat(id, message) {
if (message.startsWith("!")) {
if (message == "!help") {
api.sendMessage(
id,
"Here are some commands you can use:\n!island - Go to your island \n!resetEverything - Reset your everything\n!sellables - Show sellable items\n!help - Show this help message \n!xp - Show Levels and XP \n!withdraw (amount) - Withdraw money from bank to inventory ",
{}
);
}
if (message == "!xp") {
let xpStuff =
150 * api.getMoonstoneChestItemSlot(id, 2).attributes.customDisplayName;
if (xpStuff > 1650) {
xpStuff = "Max";
}
api.sendMessage(
id,
`You are level ${
api.getMoonstoneChestItemSlot(id, 2).attributes.customDisplayName
} with ${
api.getMoonstoneChestItemSlot(id, 3).attributes.customDisplayName
} / ${xpStuff} XP`,
{}
);
}
if (message == "!resetEverything") {
api.setPosition(id, [-346, 7, -433]);
api.sendMessage(
id,
"Are you sure you want to reset everything? !y/!n",
{}
);
resetConfirm = true;
}
if (message == "!sellables") {
api.sendMessage(
id,
"Here are the items you can sell:\n" +
Object.keys(valuableItems)
.map((item) => `${item}: $${valuableItems[item]}`)
.join("\n"),
{}
);
resetConfirm = true;
}
if (message == "!y" && resetConfirm) {
api.setMoonstoneChestItemSlot(id, 0, "Air", 1, {});
api.setMoonstoneChestItemSlot(id, 1, "Air", 1, {});
api.setMoonstoneChestItemSlot(id, 2, "Air", 1, {});
api.setMoonstoneChestItemSlot(id, 3, "Air", 1, {});
api.setMoonstoneChestItemSlot(id, 4, "Air", 1, {});
api.sendMessage(id, "Resetting...", {});
api.clearInventory(id);
api.kickPlayer(id, "Resetting your everything... Please rejoin.");
} else if (message == "!n" && resetConfirm) {
api.sendMessage(id, "Reset canceled.", {});
resetConfirm = false;
api.setPosition(id, [-346, 3, -431]);
}
if (message == "!island") {
api.sendMessage(id, "Teleporting...", {});
api.setPosition(id, [
Number(
api.getMoonstoneChestItemSlot(id, 1).attributes.customDisplayName
) + 1,
-146,
428,
]);
}
if (message.includes("!withdraw ")) {
let ammount = Number(message.replace("!withdraw ", ""));
let coins = Number(
api.getMoonstoneChestItemSlot(id, 0).attributes.customDisplayName
);
if (ammount > coins) {
api.sendMessage(id, "Ur too broke lol", { color: "red" });
return false;
} else if (api.inventoryIsFull(id)) {
api.sendMessage(id, "Ur inventory is full lol", { color: "red" });
return false;
} else if (ammount < 0) {
api.sendMessage(id, "cant withdraw negative money lol", {
color: "red",
});
} else if (coins < ammount) {
api.sendMessage(id, "brokie lol", { color: "red" });
} else if (ammount > 0) {
api.setMoonstoneChestItemSlot(id, 0, "Gold Coin", 1, {
customDisplayName: String(coins - ammount),
});
api.giveItem(id, "Gold Coin", 1, {
customDisplayName: String(ammount),
});
api.sendMessage(id, `Succesfully Withdrew $${ammount}`, {
color: "green",
});
updateUi(id);
return false;
}
}
if (api.getEntityName(id) == "BloxdMasterYT_LT5") {
if (message == "!help") {
api.sendMessage(id, "!log !yell", {});
}
if (message.includes("!log")) {
api.sendMessage(id, String(eval(message.replace("!log ", ""))), {});
}
if (message.includes("!yell")) {
eval(
api.broadcastMessage(message.replace("!yell ", ""), {
color: "lightblue",
})
);
}
}
} else {
api.broadcastMessage([
{ str: api.getEntityName(id), style: { color: "lightblue" } },
{ str: ": ", style: { color: "lightblue" } },
{ str: message },
]);
}
return false;
}
function levelUp(id) {
let currentLvl = Number(
api.getMoonstoneChestItemSlot(id, 2).attributes.customDisplayName
);
let currentXp = Number(
api.getMoonstoneChestItemSlot(id, 3).attributes.customDisplayName
);
let newXp = currentXp + 1;
if (newXp > 150 * currentLvl && currentLvl <= 12) {
api.playSound(id, "levelup", 1, 1, { playerIdOrPos: id });
api.setMoonstoneChestItemSlot(id, 2, "Messy Stone", 1, {
customDisplayName: String(Number(currentLvl + 1)),
});
api.setMoonstoneChestItemSlot(id, 3, "Messy Stone", 1, {
customDisplayName: "0",
});
api.sendMessage(
id,
"You leveled up to level " + Number(String(currentLvl + 1)) + "!",
{ color: "green" }
);
api.sendTopRightHelper(
id,
"trophy",
"You leveled up to level " + Number(String(currentLvl + 1)) + "!",
{}
);
updateUi(id);
return;
}
api.setMoonstoneChestItemSlot(id, 3, "Messy Stone", 1, {
customDisplayName: String(newXp),
});
}
function mSBR(id, x, y, z) {
setTickTimeout(() => {
let currentLvl = api.getMoonstoneChestItemSlot(id, 2).attributes
.customDisplayName++;
if (currentLvl > 11) {
currentLvl = 11;
}
let chances = Math.round(Math.random() * currentLvl);
let blocks = {
"Messy Stone": 0,
"Coal Ore": 4,
"Iron Ore": 6,
"Gold Ore": 7,
"Diamond Ore": 9,
"Moonstone Ore": 10,
};
updateUi(id);
if (blocks["Coal Ore"] == chances) {
api.setBlock(x, y, z, "Coal Ore");
} else if (blocks["Iron Ore"] == chances) {
api.setBlock(x, y, z, "Iron Ore");
} else if (blocks["Gold Ore"] == chances) {
api.setBlock(x, y, z, "Gold Ore");
} else if (blocks["Diamond Ore"] == chances) {
api.setBlock(x, y, z, "Diamond Ore");
} else {
api.setBlock(x, y, z, "Messy Stone");
}
}, 1);
}
onPlayerChangeBlock = (id, x, y, z, a, toBlock, e, i, o) => {
try {
if (
toBlock == "Lava" &&
api.getBlock(x + 2, y, z) == "Water" &&
api.getBlock(x + 1, y, z) == "Air"
) {
api.setBlock(x + 1, y, z, "Messy Stone");
}
if (
toBlock == "Lava" &&
api.getBlock(x - 2, y, z) == "Water" &&
api.getBlock(x - 1, y, z) == "Air"
) {
api.setBlock(x - 1, y, z, "Messy Stone");
}
if (
toBlock == "Lava" &&
api.getBlock(x, y, z + 2) == "Water" &&
api.getBlock(x, y, z + 1) == "Air"
) {
api.setBlock(x, y, z + 1, "Messy Stone");
}
if (
toBlock == "Lava" &&
api.getBlock(x, y, z - 2) == "Water" &&
api.getBlock(x, y, z - 1) == "Air"
) {
api.setBlock(x, y, z - 1, "Messy Stone");
}
if (
toBlock == "Water" &&
api.getBlock(x + 2, y, z) == "Lava" &&
api.getBlock(x + 1, y, z) == "Air"
) {
api.setBlock(x + 1, y, z, "Messy Stone");
}
if (
toBlock == "Water" &&
api.getBlock(x - 2, y, z) == "Lava" &&
api.getBlock(x - 1, y, z) == "Air"
) {
api.setBlock(x - 1, y, z, "Messy Stone");
}
if (
toBlock == "Water" &&
api.getBlock(x, y, z + 2) == "Lava" &&
api.getBlock(x, y, z + 1) == "Air"
) {
api.setBlock(x, y, z + 1, "Messy Stone");
}
if (
toBlock == "Water" &&
api.getBlock(x, y, z - 2) == "Lava" &&
api.getBlock(x, y, z - 1) == "Air"
) {
api.setBlock(x, y, z - 1, "Messy Stone");
}
if (
toBlock == "Air" &&
api.getBlock(x - 1, y, z) == "Lava" &&
api.getBlock(x + 1, y, z) == "Water"
) {
mSBR(id, x, y, z);
levelUp(id);
}
if (
toBlock == "Air" &&
api.getBlock(x + 1, y, z) == "Lava" &&
api.getBlock(x - 1, y, z) == "Water"
) {
mSBR(id, x, y, z);
levelUp(id);
}
if (
toBlock == "Air" &&
api.getBlock(x, y, z + 1) == "Lava" &&
api.getBlock(x, y, z - 1) == "Water"
) {
levelUp(id);
mSBR(id, x, y, z);
}
if (
toBlock == "Air" &&
api.getBlock(x, y, z - 1) == "Lava" &&
api.getBlock(x, y, z + 1) == "Water"
) {
mSBR(id, x, y, z);
levelUp(id);
}
} catch (err) {
console.log("An error occurred: " + err);
}
};
onWorldSpawnMob = (a, e, x, y, z, c, s) => {
api.setMobSetting(a, "jumpMultiplier", 0);
api.setMobSetting(a, "attackInterval", 1e9);
api.setMobSetting(a, "attackDamage", 0);
api.setMobSetting(a, "hostilityRadius", 0);
api.setMobSetting(a, "attackImpulse", 0);
api.setMobSetting(a, "secondaryAttackImpulse", 0);
api.setMobSetting(a, "secondaryAttackDamage", 0);
};