bc-minecraft-bedrock-command 1.0.17

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 (39) hide show
  1. package/LICENSE +29 -0
  2. package/README.md +13 -0
  3. package/lib/src/Lib/Data/CommandContainer.d.ts +6 -0
  4. package/lib/src/Lib/Data/CommandContainer.js +3 -0
  5. package/lib/src/Lib/Data/CommandContainer.js.map +1 -0
  6. package/lib/src/Lib/Data/CommandInfo.d.ts +36 -0
  7. package/lib/src/Lib/Data/CommandInfo.js +3 -0
  8. package/lib/src/Lib/Data/CommandInfo.js.map +1 -0
  9. package/lib/src/Lib/Data/Edu.d.ts +2 -0
  10. package/lib/src/Lib/Data/Edu.js +110 -0
  11. package/lib/src/Lib/Data/Edu.js.map +1 -0
  12. package/lib/src/Lib/Data/Vanilla.d.ts +2 -0
  13. package/lib/src/Lib/Data/Vanilla.js +2249 -0
  14. package/lib/src/Lib/Data/Vanilla.js.map +1 -0
  15. package/lib/src/Lib/Data/include.d.ts +3 -0
  16. package/lib/src/Lib/Data/include.js +16 -0
  17. package/lib/src/Lib/Data/include.js.map +1 -0
  18. package/lib/src/Lib/Types/Command/Command.d.ts +45 -0
  19. package/lib/src/Lib/Types/Command/Command.js +102 -0
  20. package/lib/src/Lib/Types/Command/Command.js.map +1 -0
  21. package/lib/src/Lib/Types/Command/Functions.d.ts +28 -0
  22. package/lib/src/Lib/Types/Command/Functions.js +213 -0
  23. package/lib/src/Lib/Types/Command/Functions.js.map +1 -0
  24. package/lib/src/Lib/Types/Command/Parameter.d.ts +18 -0
  25. package/lib/src/Lib/Types/Command/Parameter.js +27 -0
  26. package/lib/src/Lib/Types/Command/Parameter.js.map +1 -0
  27. package/lib/src/Lib/Types/Command/Parse.d.ts +19 -0
  28. package/lib/src/Lib/Types/Command/Parse.js +89 -0
  29. package/lib/src/Lib/Types/Command/Parse.js.map +1 -0
  30. package/lib/src/Lib/Types/ParameterType.d.ts +47 -0
  31. package/lib/src/Lib/Types/ParameterType.js +98 -0
  32. package/lib/src/Lib/Types/ParameterType.js.map +1 -0
  33. package/lib/src/Lib/Types/include.d.ts +4 -0
  34. package/lib/src/Lib/Types/include.js +17 -0
  35. package/lib/src/Lib/Types/include.js.map +1 -0
  36. package/lib/src/main.d.ts +2 -0
  37. package/lib/src/main.js +16 -0
  38. package/lib/src/main.js.map +1 -0
  39. package/package.json +57 -0
package/LICENSE ADDED
@@ -0,0 +1,29 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2020, Blockception Ltd
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ 1. Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ 2. Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ 3. Neither the name of the copyright holder nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/README.md ADDED
@@ -0,0 +1,13 @@
1
+ # BC-Minecraft-Bedrock-Commands
2
+
3
+ [![Npm Package & Publish](https://github.com/Blockception/BC-Minecraft-Bedrock-Command/actions/workflows/npm-publish.yml/badge.svg)](https://github.com/Blockception/BC-Minecraft-Bedrock-Command/actions/workflows/npm-publish.yml)
4
+ [![Npm Test](https://github.com/Blockception/BC-Minecraft-Bedrock-Command/actions/workflows/npm-test.yml/badge.svg)](https://github.com/Blockception/BC-Minecraft-Bedrock-Command/actions/workflows/npm-test.yml)
5
+ [![tagged-release](https://github.com/Blockception/BC-Minecraft-Bedrock-Command/actions/workflows/tagged-release.yml/badge.svg)](https://github.com/Blockception/BC-Minecraft-Bedrock-Command/actions/workflows/tagged-release.yml)
6
+ ![npm](https://img.shields.io/npm/v/bc-minecraft-bedrock-command)
7
+
8
+ A typescript package library that handles commands for minecraft bedrock
9
+
10
+ ```ts
11
+ const text = "execute @a ~ ~ ~ scoreboard players set @e[type=minecraft:sheep,r=3] range 1";
12
+ const command = Command.parse(text);
13
+ ```
@@ -0,0 +1,6 @@
1
+ import { CommandInfo } from "./include";
2
+ /**The type definition of a command container */
3
+ export declare type CommandContainer = {
4
+ /**A collection of accepted command syntaxes*/
5
+ [key: string]: CommandInfo[];
6
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=CommandContainer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommandContainer.js","sourceRoot":"","sources":["../../../../src/Lib/Data/CommandContainer.ts"],"names":[],"mappings":""}
@@ -0,0 +1,36 @@
1
+ import { ParameterType } from "../Types/ParameterType";
2
+ /**A single command syntax*/
3
+ export interface CommandInfo {
4
+ /**The name of the command*/
5
+ name: string;
6
+ /**The documentation that goes with this syntax*/
7
+ documentation: string;
8
+ /**The parameter that make this particular syntax*/
9
+ parameters: ParameterInfo[];
10
+ }
11
+ /**The information of a single parameter.*/
12
+ export interface ParameterInfo {
13
+ /**The text/keyword of the parameter.*/
14
+ text: string;
15
+ /**The type of the parameter.*/
16
+ type: ParameterType;
17
+ /**True if this parameter is required, else false.*/
18
+ required: boolean;
19
+ /**The optional options for this parameter.*/
20
+ options?: ParameterOptions;
21
+ }
22
+ /**The optional options for a given parameter.*/
23
+ export interface ParameterOptions {
24
+ /**if defined, these values are always accepted, no evualation anymore required.*/
25
+ acceptedValues?: string[];
26
+ /**Minimum value or amount of numbers.*/
27
+ minimum?: number;
28
+ /**Maximum value or amount of numbers.*/
29
+ maximum?: number;
30
+ /**Wheter or not this parameter is aimed at players only, excluding entities .*/
31
+ playerOnly?: boolean;
32
+ /**Wheter or not fake / dummy players are allowed.*/
33
+ allowFakePlayers?: boolean;
34
+ /**If the wild card: '*' is allowed.*/
35
+ wildcard?: boolean;
36
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=CommandInfo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommandInfo.js","sourceRoot":"","sources":["../../../../src/Lib/Data/CommandInfo.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import { CommandContainer } from "./CommandContainer";
2
+ export declare const Edu: CommandContainer;
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Edu = void 0;
4
+ const ParameterType_1 = require("../Types/ParameterType");
5
+ exports.Edu = {
6
+ /**The abillity command */
7
+ ability: [
8
+ {
9
+ name: "ability",
10
+ documentation: "Grants or revokes a player ability.",
11
+ parameters: [{ text: "ability", type: ParameterType_1.ParameterType.keyword, required: true }],
12
+ },
13
+ {
14
+ name: "ability",
15
+ documentation: "Returns a list of abillities assigned to the specified player",
16
+ parameters: [
17
+ { text: "ability", type: ParameterType_1.ParameterType.keyword, required: true },
18
+ { text: "player", type: ParameterType_1.ParameterType.selector, required: true, options: { playerOnly: true } },
19
+ ],
20
+ },
21
+ {
22
+ name: "ability",
23
+ documentation: "Grants or revokes a player ability to fly",
24
+ parameters: [
25
+ { text: "ability", type: ParameterType_1.ParameterType.keyword, required: true },
26
+ { text: "player", type: ParameterType_1.ParameterType.selector, required: true, options: { playerOnly: true } },
27
+ { text: "mayfly", type: ParameterType_1.ParameterType.keyword, required: true },
28
+ { text: "value", type: ParameterType_1.ParameterType.boolean, required: false },
29
+ ],
30
+ },
31
+ {
32
+ name: "ability",
33
+ documentation: "Grants or revokes a player ability to speak",
34
+ parameters: [
35
+ { text: "ability", type: ParameterType_1.ParameterType.keyword, required: true },
36
+ { text: "player", type: ParameterType_1.ParameterType.selector, required: true, options: { playerOnly: true } },
37
+ { text: "mute", type: ParameterType_1.ParameterType.keyword, required: true },
38
+ { text: "value", type: ParameterType_1.ParameterType.boolean, required: false },
39
+ ],
40
+ },
41
+ {
42
+ name: "ability",
43
+ documentation: "Grants or revokes a player ability to build",
44
+ parameters: [
45
+ { text: "ability", type: ParameterType_1.ParameterType.keyword, required: true },
46
+ { text: "player", type: ParameterType_1.ParameterType.selector, required: true, options: { playerOnly: true } },
47
+ { text: "worldbuilder", type: ParameterType_1.ParameterType.keyword, required: true },
48
+ { text: "value", type: ParameterType_1.ParameterType.boolean, required: false },
49
+ ],
50
+ },
51
+ ],
52
+ /**The classroom mode command */
53
+ classroommode: [
54
+ {
55
+ name: "classroommode",
56
+ documentation: "Launches and connects the world to the Classroom mode",
57
+ parameters: [{ text: "classroommode", type: ParameterType_1.ParameterType.keyword, required: true }],
58
+ },
59
+ ],
60
+ /**The code command */
61
+ code: [
62
+ {
63
+ name: "code",
64
+ documentation: "??",
65
+ parameters: [{ text: "code", type: ParameterType_1.ParameterType.keyword, required: true }],
66
+ },
67
+ ],
68
+ /**The gamerule command */
69
+ gamerule: [
70
+ {
71
+ name: "gamerule",
72
+ documentation: "When set to true, players may use TNT near others. You may also use specialty blocks (allow, deny, border) to help limit potential damage.",
73
+ parameters: [
74
+ { text: "gamerule", type: ParameterType_1.ParameterType.keyword, required: true },
75
+ { text: "allowdestructiveobjects", type: ParameterType_1.ParameterType.keyword, required: true },
76
+ { text: "value", type: ParameterType_1.ParameterType.boolean, required: false },
77
+ ],
78
+ },
79
+ {
80
+ name: "gamerule",
81
+ documentation: "Mobs are living, moving creatures found within the Minecraft world. Friendly (creatures like chickens and ocelots) and not so friendly mobs (creatures like creepers) are allowed to appear in the world when this is turned on.",
82
+ parameters: [
83
+ { text: "gamerule", type: ParameterType_1.ParameterType.keyword, required: true },
84
+ { text: "allowmobs", type: ParameterType_1.ParameterType.keyword, required: true },
85
+ { text: "value", type: ParameterType_1.ParameterType.boolean, required: false },
86
+ ],
87
+ },
88
+ {
89
+ name: "gamerule",
90
+ documentation: "Disables chat for all players when set to true, otherwise players in your world can communicate with each other within the world they are in via the client. Chatting is on by default.",
91
+ parameters: [
92
+ { text: "gamerule", type: ParameterType_1.ParameterType.keyword, required: true },
93
+ { text: "globalmute", type: ParameterType_1.ParameterType.keyword, required: true },
94
+ { text: "value", type: ParameterType_1.ParameterType.boolean, required: false },
95
+ ],
96
+ },
97
+ ],
98
+ /**The immutableworld command */
99
+ immutableworld: [
100
+ {
101
+ name: "immutableworld",
102
+ documentation: "Sets the immutable state of the world",
103
+ parameters: [
104
+ { text: "immutableworld", type: ParameterType_1.ParameterType.keyword, required: true },
105
+ { text: "immutableworld", type: ParameterType_1.ParameterType.boolean, required: false },
106
+ ],
107
+ },
108
+ ],
109
+ };
110
+ //# sourceMappingURL=Edu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Edu.js","sourceRoot":"","sources":["../../../../src/Lib/Data/Edu.ts"],"names":[],"mappings":";;;AAAA,0DAAuD;AAG1C,QAAA,GAAG,GAAqB;IACnC,0BAA0B;IAC1B,OAAO,EAAE;QACP;YACE,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