@minecraft/server 1.0.0 → 1.1.0-beta.1.19.60-preview.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/README.md +2 -0
  2. package/index.d.ts +14954 -213
  3. package/package.json +1 -1
  4. package/tests.ts +286 -286
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server",
3
- "version": "1.0.0",
3
+ "version": "1.1.0-beta.1.19.60-preview.23",
4
4
  "description": "",
5
5
  "contributors": [
6
6
  {
package/tests.ts CHANGED
@@ -1,286 +1,286 @@
1
- /* eslint-disable @typescript-eslint/no-unused-vars */
2
- import * as mc from '@minecraft/server';
3
-
4
- export function createExplosion(log: (message: string, status?: number) => void, targetLocation: mc.Location) {
5
- const overworld = mc.world.getDimension('overworld');
6
-
7
- log('Creating an explosion of radius 10.');
8
- overworld.createExplosion(targetLocation, 10);
9
- }
10
-
11
- export function createNoBlockExplosion(log: (message: string, status?: number) => void, targetLocation: mc.Location) {
12
- const overworld = mc.world.getDimension('overworld');
13
-
14
- const explodeNoBlocksLoc = new mc.Location(
15
- Math.floor(targetLocation.x + 1),
16
- Math.floor(targetLocation.y + 2),
17
- Math.floor(targetLocation.z + 1),
18
- );
19
-
20
- log('Creating an explosion of radius 15 that does not break blocks.');
21
- overworld.createExplosion(explodeNoBlocksLoc, 15, { breaksBlocks: false });
22
- }
23
-
24
- export function createFireAndWaterExplosions(
25
- log: (message: string, status?: number) => void,
26
- targetLocation: mc.Location,
27
- ) {
28
- const overworld = mc.world.getDimension('overworld');
29
-
30
- const explosionLoc = new mc.Location(targetLocation.x + 0.5, targetLocation.y + 0.5, targetLocation.z + 0.5);
31
-
32
- log('Creating an explosion of radius 15 that causes fire.');
33
- overworld.createExplosion(explosionLoc, 15, { causesFire: true });
34
-
35
- const belowWaterLoc = new mc.Location(targetLocation.x + 3, targetLocation.y + 1, targetLocation.z + 3);
36
-
37
- log('Creating an explosion of radius 10 that can go underwater.');
38
- overworld.createExplosion(belowWaterLoc, 10, { allowUnderwater: true });
39
- }
40
-
41
- export function itemStacks(log: (message: string, status?: number) => void, targetLocation: mc.Location) {
42
- const overworld = mc.world.getDimension('overworld');
43
-
44
- const oneItemLoc = new mc.BlockLocation(targetLocation.x + targetLocation.y + 3, 2, targetLocation.z + 1);
45
- const fiveItemsLoc = new mc.BlockLocation(targetLocation.x + 1, targetLocation.y + 2, targetLocation.z + 1);
46
- const diamondPickaxeLoc = new mc.BlockLocation(targetLocation.x + 2, targetLocation.y + 2, targetLocation.z + 4);
47
-
48
- const oneEmerald = new mc.ItemStack(mc.MinecraftItemTypes.emerald, 1, 0);
49
- const onePickaxe = new mc.ItemStack(mc.MinecraftItemTypes.diamondPickaxe, 1, 0);
50
- const fiveEmeralds = new mc.ItemStack(mc.MinecraftItemTypes.emerald, 5, 0);
51
-
52
- log(`Spawning an emerald at (${oneItemLoc.x}, ${oneItemLoc.y}, ${oneItemLoc.z})`);
53
- overworld.spawnItem(oneEmerald, oneItemLoc);
54
-
55
- log(`Spawning five emeralds at (${fiveItemsLoc.x}, ${fiveItemsLoc.y}, ${fiveItemsLoc.z})`);
56
- overworld.spawnItem(fiveEmeralds, fiveItemsLoc);
57
-
58
- log(`Spawning a diamond pickaxe at (${diamondPickaxeLoc.x}, ${diamondPickaxeLoc.y}, ${diamondPickaxeLoc.z})`);
59
- overworld.spawnItem(onePickaxe, diamondPickaxeLoc);
60
- }
61
-
62
- export function quickFoxLazyDog(log: (message: string, status?: number) => void, targetLocation: mc.Location) {
63
- const overworld = mc.world.getDimension('overworld');
64
-
65
- const fox = overworld.spawnEntity(
66
- 'minecraft:fox',
67
- new mc.BlockLocation(targetLocation.x + 1, targetLocation.y + 2, targetLocation.z + 3),
68
- );
69
- fox.addEffect(mc.MinecraftEffectTypes.speed, 10, 20);
70
- log('Created a fox.');
71
-
72
- const wolf = overworld.spawnEntity(
73
- 'minecraft:wolf',
74
- new mc.BlockLocation(targetLocation.x + 4, targetLocation.y + 2, targetLocation.z + 3),
75
- );
76
- wolf.addEffect(mc.MinecraftEffectTypes.slowness, 10, 20);
77
- wolf.isSneaking = true;
78
- log('Created a sneaking wolf.', 1);
79
- }
80
-
81
- export function runEntityCreatedEvent(log: (message: string, status?: number) => void, targetLocation: mc.Location) {
82
- // register a new function that is called when a new entity is created.
83
- mc.world.events.entityCreate.subscribe((entityEvent: mc.EntityCreateEvent) => {
84
- if (entityEvent && entityEvent.entity) {
85
- log(`New entity of type '${entityEvent.entity}' created!`, 1);
86
- } else {
87
- log(`The entity event didn't work as expected.`, -1);
88
- }
89
- });
90
- }
91
-
92
- export function createOldHorse(log: (message: string, status?: number) => void, targetLocation: mc.Location) {
93
- const overworld = mc.world.getDimension('overworld');
94
-
95
- log("Create a horse and triggering the 'ageable_grow_up' event, ensuring the horse is created as an adult");
96
- overworld.spawnEntity('minecraft:horse<minecraft:ageable_grow_up>', targetLocation);
97
- }
98
-
99
- export function pistonEvent(log: (message: string, status?: number) => void, targetLocation: mc.Location) {
100
- const pistonLoc = new mc.BlockLocation(
101
- Math.floor(targetLocation.x) + 1,
102
- Math.floor(targetLocation.y) + 2,
103
- Math.floor(targetLocation.z) + 1,
104
- );
105
-
106
- mc.world.events.beforePistonActivate.subscribe((pistonEvent: mc.BeforePistonActivateEvent) => {
107
- if (pistonEvent.piston.location.equals(pistonLoc)) {
108
- log('Cancelling piston event');
109
- pistonEvent.cancel = true;
110
- }
111
- });
112
- }
113
-
114
- export function spawnItem(log: (message: string, status?: number) => void, targetLocation: mc.Location) {
115
- const featherItem = new mc.ItemStack(mc.MinecraftItemTypes.feather, 1, 0);
116
-
117
- overworld.spawnItem(featherItem, targetLocation);
118
- log(`New feather created at ${targetLocation.x}, ${targetLocation.y}, ${targetLocation.z}!`);
119
- }
120
-
121
- export function testThatEntityIsFeatherItem(
122
- log: (message: string, status?: number) => void,
123
- targetLocation: mc.Location,
124
- ) {
125
- const overworld = mc.world.getDimension('overworld');
126
-
127
- const items = overworld.getEntities({
128
- location: targetLocation,
129
- maxDistance: 20,
130
- });
131
-
132
- for (const item of items) {
133
- const itemComp = item.getComponent('item') as any;
134
-
135
- if (itemComp) {
136
- if (itemComp.itemStack.id.endsWith('feather')) {
137
- log('Success! Found a feather', 1);
138
- }
139
- }
140
- }
141
- }
142
-
143
- export function trapTick() {
144
- const overworld = mc.world.getDimension('overworld');
145
-
146
- try {
147
- // Minecraft runs at 20 ticks per second
148
- if (ticks % 1200 === 0) {
149
- overworld.runCommandAsync('say Another minute passes...');
150
- }
151
-
152
- ticks++;
153
- } catch (e) {
154
- console.warn('Error: ' + e);
155
- }
156
-
157
- mc.system.run(trapTick);
158
- }
159
-
160
- export default class SampleManager {
161
- tickCount = 0;
162
-
163
- _availableFuncs: {
164
- [name: string]: Array<(log: (message: string, status?: number) => void, location: mc.Location) => void>;
165
- };
166
-
167
- pendingFuncs: Array<{
168
- name: string;
169
- func: (log: (message: string, status?: number) => void, location: mc.Location) => void;
170
- location: mc.Location;
171
- }> = [];
172
-
173
- gameplayLogger(message: string, status?: number) {
174
- if (status !== undefined && status > 0) {
175
- message = 'SUCCESS: ' + message;
176
- } else if (status !== undefined && status < 0) {
177
- message = 'FAIL: ' + message;
178
- }
179
-
180
- this.say(message);
181
- }
182
- say(message: string) {
183
- mc.world.getDimension('overworld').runCommand('say ' + message);
184
- }
185
-
186
- newChatMessage(chatEvent: mc.ChatEvent) {
187
- const message = chatEvent.message.toLowerCase();
188
-
189
- if (message.startsWith('howto') && chatEvent.sender) {
190
- const nearbyBlock = chatEvent.sender.getBlockFromViewVector();
191
- if (!nearbyBlock) {
192
- this.gameplayLogger('Please look at the block where you want me to run this.');
193
- return;
194
- }
195
-
196
- const nearbyBlockLoc = nearbyBlock.location;
197
- const nearbyLoc = new mc.Location(nearbyBlockLoc.x, nearbyBlockLoc.y + 1, nearbyBlockLoc.z);
198
-
199
- const sampleId = message.substring(5).trim();
200
-
201
- if (sampleId.length < 2) {
202
- let availableFuncStr = 'Here is my list of available samples:';
203
-
204
- for (const sampleFuncKey in this._availableFuncs) {
205
- availableFuncStr += ' ' + sampleFuncKey;
206
- }
207
-
208
- this.say(availableFuncStr);
209
- } else {
210
- for (const sampleFuncKey in this._availableFuncs) {
211
- if (sampleFuncKey.toLowerCase() === sampleId) {
212
- const sampleFunc = this._availableFuncs[sampleFuncKey];
213
-
214
- this.runSample(sampleFuncKey + this.tickCount, sampleFunc, nearbyLoc);
215
-
216
- return;
217
- }
218
- }
219
-
220
- this.say(`I couldn't find the sample '${sampleId}"'`);
221
- }
222
- }
223
- }
224
-
225
- runSample(
226
- sampleId: string,
227
- snippetFunctions: Array<(log: (message: string, status?: number) => void, location: mc.Location) => void>,
228
- targetLocation: mc.Location,
229
- ) {
230
- for (let i = snippetFunctions.length - 1; i >= 0; i--) {
231
- this.pendingFuncs.push({ name: sampleId, func: snippetFunctions[i], location: targetLocation });
232
- }
233
- }
234
-
235
- worldTick() {
236
- if (this.tickCount % 10 === 0) {
237
- if (this.pendingFuncs.length > 0) {
238
- const funcSet = this.pendingFuncs.pop();
239
-
240
- if (funcSet) {
241
- funcSet.func(this.gameplayLogger, funcSet.location);
242
- }
243
- }
244
- }
245
-
246
- this.tickCount++;
247
- }
248
-
249
- constructor() {
250
- this._availableFuncs = {};
251
-
252
- this.gameplayLogger = this.gameplayLogger.bind(this);
253
-
254
- mc.world.events.tick.subscribe(this.worldTick.bind(this));
255
- mc.world.events.chat.subscribe(this.newChatMessage.bind(this));
256
- }
257
-
258
- registerSamples(sampleSet: {
259
- [name: string]: Array<(log: (message: string, status?: number) => void, location: mc.Location) => void>;
260
- }) {
261
- for (const sampleKey in sampleSet) {
262
- if (sampleKey.length > 1 && sampleSet[sampleKey]) {
263
- this._availableFuncs[sampleKey] = sampleSet[sampleKey];
264
- }
265
- }
266
- }
267
- }
268
-
269
- const mojangMinecraftFuncs: {
270
- [name: string]: Array<(log: (message: string, status?: number) => void, location: mc.Location) => void>;
271
- } = {
272
- runEntityCreatedEvent: [runEntityCreatedEvent, createOldHorse],
273
- createOldHorse: [createOldHorse],
274
- spawnItem: [spawnItem, testThatEntityIsFeatherItem],
275
- createNoBlockExplosion: [createExplosion],
276
- createFireAndWaterExplosions: [createFireAndWaterExplosions],
277
- createExplosion: [createExplosion],
278
- itemStacks: [itemStacks],
279
- quickFoxLazyDog: [quickFoxLazyDog],
280
- pistonEvent: [pistonEvent],
281
- trapTick: [trapTick],
282
- };
283
-
284
- export function register(sampleManager: SampleManager) {
285
- sampleManager.registerSamples(mojangMinecraftFuncs);
286
- }
1
+ /* eslint-disable @typescript-eslint/no-unused-vars */
2
+ import * as mc from '@minecraft/server';
3
+
4
+ export function createExplosion(log: (message: string, status?: number) => void, targetLocation: mc.Location) {
5
+ const overworld = mc.world.getDimension('overworld');
6
+
7
+ log('Creating an explosion of radius 10.');
8
+ overworld.createExplosion(targetLocation, 10);
9
+ }
10
+
11
+ export function createNoBlockExplosion(log: (message: string, status?: number) => void, targetLocation: mc.Location) {
12
+ const overworld = mc.world.getDimension('overworld');
13
+
14
+ const explodeNoBlocksLoc = new mc.Location(
15
+ Math.floor(targetLocation.x + 1),
16
+ Math.floor(targetLocation.y + 2),
17
+ Math.floor(targetLocation.z + 1),
18
+ );
19
+
20
+ log('Creating an explosion of radius 15 that does not break blocks.');
21
+ overworld.createExplosion(explodeNoBlocksLoc, 15, { breaksBlocks: false });
22
+ }
23
+
24
+ export function createFireAndWaterExplosions(
25
+ log: (message: string, status?: number) => void,
26
+ targetLocation: mc.Location,
27
+ ) {
28
+ const overworld = mc.world.getDimension('overworld');
29
+
30
+ const explosionLoc = new mc.Location(targetLocation.x + 0.5, targetLocation.y + 0.5, targetLocation.z + 0.5);
31
+
32
+ log('Creating an explosion of radius 15 that causes fire.');
33
+ overworld.createExplosion(explosionLoc, 15, { causesFire: true });
34
+
35
+ const belowWaterLoc = new mc.Location(targetLocation.x + 3, targetLocation.y + 1, targetLocation.z + 3);
36
+
37
+ log('Creating an explosion of radius 10 that can go underwater.');
38
+ overworld.createExplosion(belowWaterLoc, 10, { allowUnderwater: true });
39
+ }
40
+
41
+ export function itemStacks(log: (message: string, status?: number) => void, targetLocation: mc.Location) {
42
+ const overworld = mc.world.getDimension('overworld');
43
+
44
+ const oneItemLoc = new mc.BlockLocation(targetLocation.x + targetLocation.y + 3, 2, targetLocation.z + 1);
45
+ const fiveItemsLoc = new mc.BlockLocation(targetLocation.x + 1, targetLocation.y + 2, targetLocation.z + 1);
46
+ const diamondPickaxeLoc = new mc.BlockLocation(targetLocation.x + 2, targetLocation.y + 2, targetLocation.z + 4);
47
+
48
+ const oneEmerald = new mc.ItemStack(mc.MinecraftItemTypes.emerald, 1, 0);
49
+ const onePickaxe = new mc.ItemStack(mc.MinecraftItemTypes.diamondPickaxe, 1, 0);
50
+ const fiveEmeralds = new mc.ItemStack(mc.MinecraftItemTypes.emerald, 5, 0);
51
+
52
+ log(`Spawning an emerald at (${oneItemLoc.x}, ${oneItemLoc.y}, ${oneItemLoc.z})`);
53
+ overworld.spawnItem(oneEmerald, oneItemLoc);
54
+
55
+ log(`Spawning five emeralds at (${fiveItemsLoc.x}, ${fiveItemsLoc.y}, ${fiveItemsLoc.z})`);
56
+ overworld.spawnItem(fiveEmeralds, fiveItemsLoc);
57
+
58
+ log(`Spawning a diamond pickaxe at (${diamondPickaxeLoc.x}, ${diamondPickaxeLoc.y}, ${diamondPickaxeLoc.z})`);
59
+ overworld.spawnItem(onePickaxe, diamondPickaxeLoc);
60
+ }
61
+
62
+ export function quickFoxLazyDog(log: (message: string, status?: number) => void, targetLocation: mc.Location) {
63
+ const overworld = mc.world.getDimension('overworld');
64
+
65
+ const fox = overworld.spawnEntity(
66
+ 'minecraft:fox',
67
+ new mc.BlockLocation(targetLocation.x + 1, targetLocation.y + 2, targetLocation.z + 3),
68
+ );
69
+ fox.addEffect(mc.MinecraftEffectTypes.speed, 10, 20);
70
+ log('Created a fox.');
71
+
72
+ const wolf = overworld.spawnEntity(
73
+ 'minecraft:wolf',
74
+ new mc.BlockLocation(targetLocation.x + 4, targetLocation.y + 2, targetLocation.z + 3),
75
+ );
76
+ wolf.addEffect(mc.MinecraftEffectTypes.slowness, 10, 20);
77
+ wolf.isSneaking = true;
78
+ log('Created a sneaking wolf.', 1);
79
+ }
80
+
81
+ export function runEntityCreatedEvent(log: (message: string, status?: number) => void, targetLocation: mc.Location) {
82
+ // register a new function that is called when a new entity is created.
83
+ mc.world.events.entityCreate.subscribe((entityEvent: mc.EntityCreateEvent) => {
84
+ if (entityEvent && entityEvent.entity) {
85
+ log(`New entity of type '${entityEvent.entity}' created!`, 1);
86
+ } else {
87
+ log(`The entity event didn't work as expected.`, -1);
88
+ }
89
+ });
90
+ }
91
+
92
+ export function createOldHorse(log: (message: string, status?: number) => void, targetLocation: mc.Location) {
93
+ const overworld = mc.world.getDimension('overworld');
94
+
95
+ log("Create a horse and triggering the 'ageable_grow_up' event, ensuring the horse is created as an adult");
96
+ overworld.spawnEntity('minecraft:horse<minecraft:ageable_grow_up>', targetLocation);
97
+ }
98
+
99
+ export function pistonEvent(log: (message: string, status?: number) => void, targetLocation: mc.Location) {
100
+ const pistonLoc = new mc.BlockLocation(
101
+ Math.floor(targetLocation.x) + 1,
102
+ Math.floor(targetLocation.y) + 2,
103
+ Math.floor(targetLocation.z) + 1,
104
+ );
105
+
106
+ mc.world.events.beforePistonActivate.subscribe((pistonEvent: mc.BeforePistonActivateEvent) => {
107
+ if (pistonEvent.piston.location.equals(pistonLoc)) {
108
+ log('Cancelling piston event');
109
+ pistonEvent.cancel = true;
110
+ }
111
+ });
112
+ }
113
+
114
+ export function spawnItem(log: (message: string, status?: number) => void, targetLocation: mc.Location) {
115
+ const featherItem = new mc.ItemStack(mc.MinecraftItemTypes.feather, 1, 0);
116
+
117
+ overworld.spawnItem(featherItem, targetLocation);
118
+ log(`New feather created at ${targetLocation.x}, ${targetLocation.y}, ${targetLocation.z}!`);
119
+ }
120
+
121
+ export function testThatEntityIsFeatherItem(
122
+ log: (message: string, status?: number) => void,
123
+ targetLocation: mc.Location,
124
+ ) {
125
+ const overworld = mc.world.getDimension('overworld');
126
+
127
+ const items = overworld.getEntities({
128
+ location: targetLocation,
129
+ maxDistance: 20,
130
+ });
131
+
132
+ for (const item of items) {
133
+ const itemComp = item.getComponent('item') as any;
134
+
135
+ if (itemComp) {
136
+ if (itemComp.itemStack.id.endsWith('feather')) {
137
+ log('Success! Found a feather', 1);
138
+ }
139
+ }
140
+ }
141
+ }
142
+
143
+ export function trapTick() {
144
+ const overworld = mc.world.getDimension('overworld');
145
+
146
+ try {
147
+ // Minecraft runs at 20 ticks per second
148
+ if (ticks % 1200 === 0) {
149
+ overworld.runCommandAsync('say Another minute passes...');
150
+ }
151
+
152
+ ticks++;
153
+ } catch (e) {
154
+ console.warn('Error: ' + e);
155
+ }
156
+
157
+ mc.system.run(trapTick);
158
+ }
159
+
160
+ export default class SampleManager {
161
+ tickCount = 0;
162
+
163
+ _availableFuncs: {
164
+ [name: string]: Array<(log: (message: string, status?: number) => void, location: mc.Location) => void>;
165
+ };
166
+
167
+ pendingFuncs: Array<{
168
+ name: string;
169
+ func: (log: (message: string, status?: number) => void, location: mc.Location) => void;
170
+ location: mc.Location;
171
+ }> = [];
172
+
173
+ gameplayLogger(message: string, status?: number) {
174
+ if (status !== undefined && status > 0) {
175
+ message = 'SUCCESS: ' + message;
176
+ } else if (status !== undefined && status < 0) {
177
+ message = 'FAIL: ' + message;
178
+ }
179
+
180
+ this.say(message);
181
+ }
182
+ say(message: string) {
183
+ mc.world.getDimension('overworld').runCommand('say ' + message);
184
+ }
185
+
186
+ newChatMessage(chatEvent: mc.ChatEvent) {
187
+ const message = chatEvent.message.toLowerCase();
188
+
189
+ if (message.startsWith('howto') && chatEvent.sender) {
190
+ const nearbyBlock = chatEvent.sender.getBlockFromViewVector();
191
+ if (!nearbyBlock) {
192
+ this.gameplayLogger('Please look at the block where you want me to run this.');
193
+ return;
194
+ }
195
+
196
+ const nearbyBlockLoc = nearbyBlock.location;
197
+ const nearbyLoc = new mc.Location(nearbyBlockLoc.x, nearbyBlockLoc.y + 1, nearbyBlockLoc.z);
198
+
199
+ const sampleId = message.substring(5).trim();
200
+
201
+ if (sampleId.length < 2) {
202
+ let availableFuncStr = 'Here is my list of available samples:';
203
+
204
+ for (const sampleFuncKey in this._availableFuncs) {
205
+ availableFuncStr += ' ' + sampleFuncKey;
206
+ }
207
+
208
+ this.say(availableFuncStr);
209
+ } else {
210
+ for (const sampleFuncKey in this._availableFuncs) {
211
+ if (sampleFuncKey.toLowerCase() === sampleId) {
212
+ const sampleFunc = this._availableFuncs[sampleFuncKey];
213
+
214
+ this.runSample(sampleFuncKey + this.tickCount, sampleFunc, nearbyLoc);
215
+
216
+ return;
217
+ }
218
+ }
219
+
220
+ this.say(`I couldn't find the sample '${sampleId}"'`);
221
+ }
222
+ }
223
+ }
224
+
225
+ runSample(
226
+ sampleId: string,
227
+ snippetFunctions: Array<(log: (message: string, status?: number) => void, location: mc.Location) => void>,
228
+ targetLocation: mc.Location,
229
+ ) {
230
+ for (let i = snippetFunctions.length - 1; i >= 0; i--) {
231
+ this.pendingFuncs.push({ name: sampleId, func: snippetFunctions[i], location: targetLocation });
232
+ }
233
+ }
234
+
235
+ worldTick() {
236
+ if (this.tickCount % 10 === 0) {
237
+ if (this.pendingFuncs.length > 0) {
238
+ const funcSet = this.pendingFuncs.pop();
239
+
240
+ if (funcSet) {
241
+ funcSet.func(this.gameplayLogger, funcSet.location);
242
+ }
243
+ }
244
+ }
245
+
246
+ this.tickCount++;
247
+ }
248
+
249
+ constructor() {
250
+ this._availableFuncs = {};
251
+
252
+ this.gameplayLogger = this.gameplayLogger.bind(this);
253
+
254
+ mc.world.events.tick.subscribe(this.worldTick.bind(this));
255
+ mc.world.events.chat.subscribe(this.newChatMessage.bind(this));
256
+ }
257
+
258
+ registerSamples(sampleSet: {
259
+ [name: string]: Array<(log: (message: string, status?: number) => void, location: mc.Location) => void>;
260
+ }) {
261
+ for (const sampleKey in sampleSet) {
262
+ if (sampleKey.length > 1 && sampleSet[sampleKey]) {
263
+ this._availableFuncs[sampleKey] = sampleSet[sampleKey];
264
+ }
265
+ }
266
+ }
267
+ }
268
+
269
+ const mojangMinecraftFuncs: {
270
+ [name: string]: Array<(log: (message: string, status?: number) => void, location: mc.Location) => void>;
271
+ } = {
272
+ runEntityCreatedEvent: [runEntityCreatedEvent, createOldHorse],
273
+ createOldHorse: [createOldHorse],
274
+ spawnItem: [spawnItem, testThatEntityIsFeatherItem],
275
+ createNoBlockExplosion: [createExplosion],
276
+ createFireAndWaterExplosions: [createFireAndWaterExplosions],
277
+ createExplosion: [createExplosion],
278
+ itemStacks: [itemStacks],
279
+ quickFoxLazyDog: [quickFoxLazyDog],
280
+ pistonEvent: [pistonEvent],
281
+ trapTick: [trapTick],
282
+ };
283
+
284
+ export function register(sampleManager: SampleManager) {
285
+ sampleManager.registerSamples(mojangMinecraftFuncs);
286
+ }