Skip to content

Commit

Permalink
- /schedule command delay arg
Browse files Browse the repository at this point in the history
  • Loading branch information
Xterionix committed Dec 6, 2024
1 parent 561f83d commit b7279c9
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
14 changes: 14 additions & 0 deletions src/lib/data/vanilla/schedule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,20 @@ export const schedule: CommandInfo[] = [
{ text: "delay", type: ParameterType.keyword, required: true },
{ text: "add", type: ParameterType.keyword, required: true },
{ text: "function", type: ParameterType.function, required: true },
{ text: "time", type: ParameterType.timeInTicks, required: true },
{ text: "append", type: ParameterType.keyword, required: false },
],
},
{
name: "schedule",
documentation: "Schedules an action to be executed once an area is loaded, or after a certain amount of time",
parameters: [
{ text: "schedule", type: ParameterType.keyword, required: true },
{ text: "delay", type: ParameterType.keyword, required: true },
{ text: "add", type: ParameterType.keyword, required: true },
{ text: "function", type: ParameterType.function, required: true },
{ text: "time", type: ParameterType.timeInTicks, required: true },
{ text: "replace", type: ParameterType.keyword, required: false },
],
},
];
3 changes: 3 additions & 0 deletions src/lib/documentation/parameter-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,9 @@ The identifier of a ticking area.`,
[ParameterType.time]: `## Time
A value representing the time of the game.`,

[ParameterType.timeInTicks]: `## Time in ticks
A value representing the time of the game (20D, 3S, 15T, 4).`,

//[ParameterType.unknown]:``,

[ParameterType.xp]: `## XP
Expand Down
3 changes: 2 additions & 1 deletion src/lib/types/command/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ const Matches: Partial<Record<ParameterType, (item: string) => boolean>> = {
[ParameterType.structureAnimationMode]: (item) => Modes.StructureAnimation.isValue(item),
[ParameterType.teleportRules]: (item) => Modes.TeleportRules.isValue(item),
[ParameterType.time]: (item) => Modes.Time.isValue(item),
[ParameterType.xp]: (item) => Minecraft.XP.is(item),
[ParameterType.timeInTicks]: (item) => Modes.Time.isValue(item),
[ParameterType.xp]: (item) => Minecraft.timeInTicks.is(item),

Check failure on line 131 in src/lib/types/command/functions.ts

View workflow job for this annotation

GitHub Actions / 📋 Test on ubuntu-latest

Property 'timeInTicks' does not exist on type 'typeof import("/home/runner/work/BC-Minecraft-Bedrock-Command/BC-Minecraft-Bedrock-Command/node_modules/bc-minecraft-bedrock-types/lib/minecraft/index")'.

Check failure on line 131 in src/lib/types/command/functions.ts

View workflow job for this annotation

GitHub Actions / 📋 Test on macOS-latest

Property 'timeInTicks' does not exist on type 'typeof import("/Users/runner/work/BC-Minecraft-Bedrock-Command/BC-Minecraft-Bedrock-Command/node_modules/bc-minecraft-bedrock-types/lib/minecraft/index")'.
};

export function checkRequiredParameterLength(command: Command, data: CommandInfo): boolean {
Expand Down
2 changes: 2 additions & 0 deletions src/lib/types/parameter-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ export enum ParameterType {
tickingarea,
/** Time mode */
time,
/** Time in ticks */
timeInTicks,
/** Unknown */
unknown,
/** XP */
Expand Down

0 comments on commit b7279c9

Please sign in to comment.