forked from JaylyDev/ScriptAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtests.js
More file actions
14 lines (14 loc) · 808 Bytes
/
tests.js
File metadata and controls
14 lines (14 loc) · 808 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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("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();
});