Skip to content

Commit

Permalink
Updated for 1.21.50 again (#173)
Browse files Browse the repository at this point in the history
* Create aimassist.ts
* Update command-data with aimassist command
* Added timeInTicks documentation
* Added timeInTicks parameter
* Added timeInTicks to Matches
* Update /schedule
* Update /loot for mine
* Update loot.ts
  • Loading branch information
Xterionix authored Feb 14, 2025
1 parent 3fbd675 commit 85a366a
Show file tree
Hide file tree
Showing 7 changed files with 384 additions and 10 deletions.
2 changes: 2 additions & 0 deletions src/lib/data/command-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ import { tp } from "./vanilla/tp";
import { w } from "./vanilla/w";
import { weather } from "./vanilla/weather";
import { xp } from "./vanilla/xp";
import { aimassist } from './vanilla/aimassist';

/** The minecraft command data set */
export namespace CommandData {
Expand All @@ -83,6 +84,7 @@ export namespace CommandData {

/** The vanilla command data set */
export const Vanilla: CommandContainer = {
aimassist,
alwaysday,
camera,
camerashake,
Expand Down
56 changes: 56 additions & 0 deletions src/lib/data/vanilla/aimassist.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import { ParameterType } from "../../types/parameter-type";
import { CommandInfo } from "../command-info";

/**The aimassist command */
export const aimassist: CommandInfo[] = [
{
name: "aimassist",
documentation: "Enable Aim Assit",
parameters: [
{ text: "aimassist", type: ParameterType.keyword, required: true },
{
text: "player",
type: ParameterType.selector,
required: true,
options: { playerOnly: true },
},
{ text: "clear", type: ParameterType.keyword, required: true },
],
},
{
name: "aimassist",
documentation: "Enable Aim Assit",
parameters: [
{ text: "aimassist", type: ParameterType.keyword, required: true },
{
text: "player",
type: ParameterType.selector,
required: true,
options: { playerOnly: true },
},
{ text: "set", type: ParameterType.keyword, required: true },
{ text: "x angle", type: ParameterType.float, required: false, options: { minimum: 10, maximum: 90 } },
{ text: "y angle", type: ParameterType.float, required: false, options: { minimum: 10, maximum: 90 } },
{ text: "max distance", type: ParameterType.float, required: false, options: { minimum: 1, maximum: 16 } },
{ text: "angle", type: ParameterType.keyword, required: false }
],
},
{
name: "aimassist",
documentation: "Enable Aim Assit",
parameters: [
{ text: "aimassist", type: ParameterType.keyword, required: true },
{
text: "player",
type: ParameterType.selector,
required: true,
options: { playerOnly: true },
},
{ text: "set", type: ParameterType.keyword, required: true },
{ text: "x angle", type: ParameterType.float, required: false, options: { minimum: 10, maximum: 90 } },
{ text: "y angle", type: ParameterType.float, required: false, options: { minimum: 10, maximum: 90 } },
{ text: "max distance", type: ParameterType.float, required: false, options: { minimum: 1, maximum: 16 } },
{ text: "distance", type: ParameterType.keyword, required: false }
],
},
];
258 changes: 249 additions & 9 deletions src/lib/data/vanilla/loot.ts

Large diffs are not rendered by default.

71 changes: 70 additions & 1 deletion src/lib/data/vanilla/schedule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,73 @@ export const schedule: CommandInfo[] = [
{ text: "function", type: ParameterType.function, required: true },
],
},
];
{
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: "on_area_loaded", type: ParameterType.keyword, required: true },
{ text: "clear", type: ParameterType.keyword, required: true },
{ text: "function", type: ParameterType.function, required: true },
],
},
{
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: "on_area_loaded", type: ParameterType.keyword, required: true },
{ text: "clear", type: ParameterType.keyword, required: true },
{ text: "tickingarea", type: ParameterType.keyword, required: true },
{
text: "tickingarea name",
type: ParameterType.tickingarea,
required: true,
},
{ text: "function", type: ParameterType.function, required: true },
],
},
{
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: "clear", type: ParameterType.keyword, required: true },
{ text: "function", type: ParameterType.function, required: true },
],
},
{
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: "clear", type: ParameterType.keyword, required: true },
{ text: "function", type: ParameterType.function, required: true },
],
},
{
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: "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 },
],
},
];
4 changes: 4 additions & 0 deletions src/lib/documentation/parameter-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,10 @@ 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
1 change: 1 addition & 0 deletions src/lib/types/command/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ 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.timeInTicks]: (item) => Modes.Time.isValue(item),
[ParameterType.xp]: (item) => Minecraft.XP.is(item),
};

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 85a366a

Please sign in to comment.