Skip to content

Commit

Permalink
compatible with latest preview
Browse files Browse the repository at this point in the history
  • Loading branch information
JaylyDev committed Aug 23, 2023
1 parent 6d881b7 commit 4428fd6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/cl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ jobs:
find ./docs/* -maxdepth 5 -name package.json -execdir sh -c 'pwd && npm install' \;
- name: Type Check
run: |
tsc --build --verbose
cp -r dist/* .
run: tsc --build

- name: Format Check
run: node ./dist/tools/index.js
Expand Down
2 changes: 1 addition & 1 deletion scripts/events-log/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ world.afterEvents.entityHealthChanged.subscribe(callback);
world.afterEvents.entityHitBlock.subscribe(callback);
world.afterEvents.entityHitEntity.subscribe(callback);
world.afterEvents.entityHurt.subscribe(callback);
world.afterEvents.entityRemoved.subscribe(callback);
world.afterEvents.entityRemove.subscribe(callback);
world.afterEvents.entitySpawn.subscribe(callback);
world.afterEvents.explosion.subscribe(callback);
world.afterEvents.itemCompleteUse.subscribe(callback);
Expand Down
2 changes: 1 addition & 1 deletion scripts/events-log/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ world.afterEvents.entityHealthChanged.subscribe(callback);
world.afterEvents.entityHitBlock.subscribe(callback);
world.afterEvents.entityHitEntity.subscribe(callback);
world.afterEvents.entityHurt.subscribe(callback);
world.afterEvents.entityRemoved.subscribe(callback)
world.afterEvents.entityRemove.subscribe(callback)
world.afterEvents.entitySpawn.subscribe(callback);
world.afterEvents.explosion.subscribe(callback);
world.afterEvents.itemCompleteUse.subscribe(callback);
Expand Down
7 changes: 4 additions & 3 deletions scripts/spawn-simulated-player/tests.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { world, MinecraftItemTypes, ItemStack, } from "@minecraft/server";
import { world, ItemStack, } from "@minecraft/server";
import { MinecraftEffectTypes } from "@minecraft/vanilla-data";
import { SpawnSimulatedPlayer } from "./index.js";
let host = [...world.getPlayers()][0];
const money = world.scoreboard.getObjective("money") ?? world.scoreboard.addObjective("money", "money");
SpawnSimulatedPlayer(host, function (simulatedPlayer) {
simulatedPlayer.addEffect(MinecraftEffectTypes.Absorption, 1);
simulatedPlayer.attack();
simulatedPlayer.dimension.createExplosion(simulatedPlayer.location, 5);
simulatedPlayer.giveItem(new ItemStack(MinecraftItemTypes.acaciaBoat));
simulatedPlayer.runCommandAsync("scoreboard players add @s money 1");
simulatedPlayer.giveItem(new ItemStack("minecraft:acacia_boat"));
money.addScore(simulatedPlayer, 1);
simulatedPlayer.teleport({ x: 0, y: 0, z: 0 }, { dimension: simulatedPlayer.dimension, rotation: { x: 0, y: 0 } });
simulatedPlayer.despawn();
});

0 comments on commit 4428fd6

Please sign in to comment.