From 26df46e389e9fe6d7d4f4f39c7ed34bbbed6f5e7 Mon Sep 17 00:00:00 2001 From: jayly-bot <121162959+jayly-bot@users.noreply.github.com> Date: Sat, 12 Aug 2023 20:10:35 +0000 Subject: [PATCH] Upload generated files --- legacyPackages.json | 26 ++++----- package.json | 72 ++++++++++++------------- scripts/spawn-simulated-player/tests.js | 7 +-- 3 files changed, 53 insertions(+), 52 deletions(-) diff --git a/legacyPackages.json b/legacyPackages.json index 0d0f949b..e76d7a6e 100644 --- a/legacyPackages.json +++ b/legacyPackages.json @@ -1,14 +1,14 @@ { - "packages": [ - "chat-rank", - "dimensions", - "get-scores", - "is-host", - "is-operator", - "lz-string", - "remove-permission", - "run-command-async", - "set-permission", - "shopui" - ] -} \ No newline at end of file + "packages": [ + "chat-rank", + "dimensions", + "get-scores", + "is-host", + "is-operator", + "lz-string", + "remove-permission", + "run-command-async", + "set-permission", + "shopui" + ] +} diff --git a/package.json b/package.json index 4debb3cf..63d2a0e5 100644 --- a/package.json +++ b/package.json @@ -1,38 +1,38 @@ { - "name": "script-api", - "description": "this repository is filled with community driven scripts for Minecraft scripting", - "version": "1.0.0", - "scripts": { - "test": "tsc", - "build": "tsc --build", - "tools": "cd tools && tsc", - "ci": "cd scripts && tsc" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/JaylyDev/ScriptAPI.git" - }, - "keywords": [], - "license": "MIT", - "bugs": { - "url": "https://github.com/JaylyDev/ScriptAPI/issues" - }, - "homepage": "https://github.com/JaylyDev/ScriptAPI#readme", - "dependencies": { - "@minecraft/server": "1.6.0-beta.1.20.30-preview.21", - "@minecraft/server-admin": "1.0.0-beta.1.20.30-preview.21", - "@minecraft/server-editor": "0.1.0-beta.1.20.30-preview.21", - "@minecraft/server-gametest": "1.0.0-beta.1.20.30-preview.21", - "@minecraft/server-net": "1.0.0-beta.1.20.30-preview.21", - "@minecraft/server-ui": "1.2.0-beta.1.20.30-preview.21", - "@minecraft/vanilla-data": "1.20.30-preview.21" - }, - "devDependencies": { - "@npm/types": "^1.0.2", - "@types/node": "^20.4.10", - "@types/parsimmon": "^1.10.6", - "axios": "^1.4.0", - "parsimmon": "^1.18.1", - "typescript": "^5.1.6" - } + "name": "script-api", + "description": "this repository is filled with community driven scripts for Minecraft scripting", + "version": "1.0.0", + "scripts": { + "test": "tsc", + "build": "tsc --build", + "tools": "cd tools && tsc", + "ci": "cd scripts && tsc" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/JaylyDev/ScriptAPI.git" + }, + "keywords": [], + "license": "MIT", + "bugs": { + "url": "https://github.com/JaylyDev/ScriptAPI/issues" + }, + "homepage": "https://github.com/JaylyDev/ScriptAPI#readme", + "dependencies": { + "@minecraft/server": "1.6.0-beta.1.20.30-preview.21", + "@minecraft/server-admin": "1.0.0-beta.1.20.30-preview.21", + "@minecraft/server-editor": "0.1.0-beta.1.20.30-preview.21", + "@minecraft/server-gametest": "1.0.0-beta.1.20.30-preview.21", + "@minecraft/server-net": "1.0.0-beta.1.20.30-preview.21", + "@minecraft/server-ui": "1.2.0-beta.1.20.30-preview.21", + "@minecraft/vanilla-data": "1.20.30-preview.21" + }, + "devDependencies": { + "@npm/types": "^1.0.2", + "@types/node": "^20.4.10", + "@types/parsimmon": "^1.10.6", + "axios": "^1.4.0", + "parsimmon": "^1.18.1", + "typescript": "^5.1.6" + } } diff --git a/scripts/spawn-simulated-player/tests.js b/scripts/spawn-simulated-player/tests.js index 814443ca..8b60d1f9 100644 --- a/scripts/spawn-simulated-player/tests.js +++ b/scripts/spawn-simulated-player/tests.js @@ -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(); });