-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
53 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
{ | ||
"packages": [ | ||
"chat-rank", | ||
"dimensions", | ||
"get-scores", | ||
"is-host", | ||
"is-operator", | ||
"lz-string", | ||
"remove-permission", | ||
"run-command-async", | ||
"set-permission", | ||
"shopui" | ||
] | ||
} | ||
"packages": [ | ||
"chat-rank", | ||
"dimensions", | ||
"get-scores", | ||
"is-host", | ||
"is-operator", | ||
"lz-string", | ||
"remove-permission", | ||
"run-command-async", | ||
"set-permission", | ||
"shopui" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}); |