Skip to content

Commit

Permalink
Added /place (#192)
Browse files Browse the repository at this point in the history
* - Added /place

* - Fix /place
  • Loading branch information
Xterionix authored Feb 17, 2025
1 parent 8f9dcd3 commit fff04b2
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/lib/data/command-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ import { w } from "./vanilla/w";
import { weather } from "./vanilla/weather";
import { xp } from "./vanilla/xp";
import { aimassist } from './vanilla/aimassist';
import { place } from './vanilla/place';

/** The minecraft command data set */
export namespace CommandData {
Expand Down Expand Up @@ -117,6 +118,7 @@ export namespace CommandData {
music,
op,
particle,
place,
playanimation,
playsound,
recipe,
Expand Down
61 changes: 61 additions & 0 deletions src/lib/data/vanilla/place.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import { ParameterType } from "../../types/parameter-type";
import { CommandInfo } from "../command-info";

/**The place command */
export const place: CommandInfo[] = [
{
name: "place",
documentation: "Places a jigsaw structure, feature or feature rule in the world",
parameters: [
{ text: "place", type: ParameterType.keyword, required: true },
{ text: "feature", type: ParameterType.keyword, required: true },
{ text: "feature", type: ParameterType.string, required: true },
{ text: "position x", type: ParameterType.coordinate, required: false },
{ text: "position y", type: ParameterType.coordinate, required: false },
{ text: "position z", type: ParameterType.coordinate, required: false },
],
},
{
name: "place",
documentation: "Places a jigsaw structure, feature or feature rule in the world",
parameters: [
{ text: "place", type: ParameterType.keyword, required: true },
{ text: "featurerule", type: ParameterType.keyword, required: true },
{ text: "featurerule", type: ParameterType.string, required: true },
{ text: "position x", type: ParameterType.coordinate, required: false },
{ text: "position y", type: ParameterType.coordinate, required: false },
{ text: "position z", type: ParameterType.coordinate, required: false },
],
},
{
name: "place",
documentation: "Places a jigsaw structure, feature or feature rule in the world",
parameters: [
{ text: "place", type: ParameterType.keyword, required: true },
{ text: "jigsaw", type: ParameterType.keyword, required: true },
{ text: "pool", type: ParameterType.jigsaw, required: true },
{ text: "jigsawTarget", type: ParameterType.string, required: true },
{ text: "maxDepth", type: ParameterType.integer, required: true },
{ text: "position x", type: ParameterType.coordinate, required: false },
{ text: "position y", type: ParameterType.coordinate, required: false },
{ text: "position z", type: ParameterType.coordinate, required: false },
{ text: "keepJigsaws", type: ParameterType.boolean, required: false },
{ text: "includeEntities", type: ParameterType.boolean, required: false },
],
},
{
name: "place",
documentation: "Places a jigsaw structure, feature or feature rule in the world",
parameters: [
{ text: "place", type: ParameterType.keyword, required: true },
{ text: "structure", type: ParameterType.keyword, required: true },
{ text: "structure", type: ParameterType.string, required: true },
{ text: "position x", type: ParameterType.coordinate, required: false },
{ text: "position y", type: ParameterType.coordinate, required: false },
{ text: "position z", type: ParameterType.coordinate, required: false },
{ text: "ignoreStartHeight", type: ParameterType.boolean, required: false },
{ text: "keepJigsaws", type: ParameterType.boolean, required: false },
{ text: "includeEntities", type: ParameterType.boolean, required: false },
],
},
];
5 changes: 4 additions & 1 deletion src/lib/documentation/parameter-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ A raw text is a way to specify the text of a text component.`,
[ParameterType.lootTable]: `## Loot Table
The identifier of a loot table.`,

[ParameterType.jigsaw]: `## Jigsaw
The path to a jigsaw pool.`,

[ParameterType.locateFeature]: `## Locate Feature
A value representing the different world features.\
${sumMode(Modes.LocateFeature)}`,
Expand Down Expand Up @@ -221,7 +224,7 @@ 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).`,

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 @@ -112,6 +112,7 @@ const Matches: Partial<Record<ParameterType, (item: string) => boolean>> = {
[ParameterType.jsonRawText]: (item) => General.Json.isObject(item),
[ParameterType.locateFeature]: (item) => Modes.LocateFeature.isValue(item),
[ParameterType.lootTable]: (item) => General.String.is(item),
[ParameterType.jigsaw]: (item) => General.String.is(item),
[ParameterType.maskMode]: (item) => Modes.Mask.isValue(item),
[ParameterType.mirror]: (item) => Modes.Mirror.isValue(item),
[ParameterType.musicRepeatMode]: (item) => Modes.MusicRepeat.isValue(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 @@ -58,6 +58,8 @@ export enum ParameterType {
keyword,
/** A loot table */
lootTable,
/** A loot table */
jigsaw,
/** Locates feature mode */
locateFeature,
/** Message */
Expand Down

0 comments on commit fff04b2

Please sign in to comment.