-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcode_spring2022.js
81 lines (81 loc) · 1.93 KB
/
code_spring2022.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
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
player.onChat("line", function () {
builder.line(GRASS)
})
mobs.onMobKilled(SQUID, function () {
if (isSwimming == 1) {
mobs.give(
mobs.target(NEAREST_PLAYER),
DIAMOND_BLOCK,
1
)
}
})
player.onTravelled(SWIM_WATER, function () {
isSwimming = 0
})
player.onChat("fill", function () {
builder.fill(END_PORTAL)
})
player.onChat("Superrun", function () {
mobs.applyEffect(SPEED, mobs.target(LOCAL_PLAYER), 10, 39)
})
player.onChat("test", function () {
agent.teleportToPlayer()
agent.move(FORWARD, 5)
agent.setSlot(1)
agent.setAssist(PLACE_ON_MOVE, true)
agent.setAssist(DESTROY_OBSTACLES, true)
for (let index = 0; index < 10; index++) {
for (let index = 0; index < 4; index++) {
agent.setItem(LOG_OAK, 64, 1)
agent.move(FORWARD, 4)
agent.turn(LEFT_TURN)
}
agent.move(UP, 1)
}
})
player.onTravelled(WALK, function () {
isSwimming = 1
})
loops.forever(function () {
if (blocks.testForBlock(GRASS, pos(0, -1, 0))) {
mobs.spawn(list._pickRandom(), pos(0, 0, 0))
}
})
player.onChat("enchant", function () {
mobs.give(
mobs.target(NEAREST_PLAYER),
DIAMOND_SWORD,
1
)
mobs.enchant(
mobs.target(NEAREST_PLAYER),
"Sharpness",
1
)
})
player.onChat("Sort", function () {
let text_list: string[] = []
gameplay.title(mobs.target(ALL_PLAYERS), text_list._pickRandom(), "")
})
player.onChat("trace", function () {
builder.tracePath(SMOOTH_SANDSTONE)
})
player.onChat("mark", function () {
builder.mark()
})
player.onItemInteracted(STICK, function () {
for (let index = 0; index < 10; index++) {
mobs.spawn(Mobs._pickRandom(), positions.groundPosition(posCamera(0, 0, randint(10, 20))))
}
})
let isSwimming = 0
let Mobs: number[] = []
let list: number[] = []
list = [
CHICKEN,
COW,
PIG,
SHEEP
]
Mobs = [PRIMED_TNT, LIGHTNING_BOLT, FIREWORKS_ROCKET]