From 2f39c32629bff74180d3b7b470ce0c9bd30a5173 Mon Sep 17 00:00:00 2001 From: ForestOfLight Date: Mon, 29 Dec 2025 22:36:43 -0800 Subject: [PATCH] rename /item to /construct and remove ./construct --- README.md | 5 +---- packs/BP/scripts/commands/construct.js | 20 +++++--------------- packs/RP/texts/en_US.lang | 9 ++++----- 3 files changed, 10 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 11d40ef..e4523d9 100644 --- a/README.md +++ b/README.md @@ -52,12 +52,9 @@ Construct uses Minecraft's vanilla structure system so that you can easily creat ### Commands -**Usage: `/construct:item`** +**Usage: `/construct:construct`** Gives you the Construct item. Use it to open the Construct menu. -**Usage: `./construct`** -Shows the Construct menu. Only available while **Canopy** is installed. - ## Join the Community Need help, want to discuss technical Minecraft, or follow future updates? [**Join our Discord!**](https://discord.gg/9KGche8fxm) diff --git a/packs/BP/scripts/commands/construct.js b/packs/BP/scripts/commands/construct.js index ca7a863..05b3ab8 100644 --- a/packs/BP/scripts/commands/construct.js +++ b/packs/BP/scripts/commands/construct.js @@ -1,5 +1,3 @@ -import { Command } from '../lib/canopy/CanopyExtension'; -import { extension } from '../config'; import { world, system, EntityComponentTypes, ItemStack, CommandPermissionLevel, CustomCommandStatus, Player } from '@minecraft/server'; import { MenuForm } from '../classes/MenuForm'; import { structureCollection } from '../classes/Structure/StructureCollection' @@ -7,18 +5,10 @@ import { Builders } from '../classes/Builder/Builders'; export const MENU_ITEM = 'construct:menu'; -const menuCmd = new Command({ - name: 'construct', - description: { translate: 'construct.commands.construct' }, - usage: 'construct', - callback: (sender) => openMenu(sender) -}); -extension.addCommand(menuCmd); - system.beforeEvents.startup.subscribe((event) => { const command = { - name: 'construct:item', - description: 'construct.commands.item', + name: 'construct:construct', + description: 'construct.commands.construct', permissionLevel: CommandPermissionLevel.Any, cheatsRequired: false }; @@ -28,13 +18,13 @@ system.beforeEvents.startup.subscribe((event) => { function givePlayerConstructItem(origin) { const player = origin.sourceEntity; if (player instanceof Player === false) - return { status: CustomCommandStatus.Failure, message: 'construct.commands.item.denyorigin' }; + return { status: CustomCommandStatus.Failure, message: 'construct.commands.construct.denyorigin' }; system.run(() => { const givenItemStack = player.getComponent(EntityComponentTypes.Inventory)?.container?.addItem(new ItemStack(MENU_ITEM)); if (givenItemStack) - player.sendMessage({ translate: 'construct.commands.item.fail' }); + player.sendMessage({ translate: 'construct.commands.construct.fail' }); else - player.sendMessage({ translate: 'construct.commands.item.success' }); + player.sendMessage({ translate: 'construct.commands.construct.success' }); }); return { status: CustomCommandStatus.Success }; } diff --git a/packs/RP/texts/en_US.lang b/packs/RP/texts/en_US.lang index eaea005..4c64d02 100644 --- a/packs/RP/texts/en_US.lang +++ b/packs/RP/texts/en_US.lang @@ -85,11 +85,10 @@ construct.mainmenu.howto.remove.header=§cHow to Remove Structures: construct.mainmenu.howto.remove.body=§7- Use the §f/structure delete§7 command to remove a structure from the world. ## Commands -construct.commands.construct=Opens the Construct menu. -construct.commands.item=Gives you the Construct item. Use it to open the Construct menu. -construct.commands.item.denyorigin=This command can only be used by players. -construct.commands.item.fail=§cFailed to give you the Construct item. -construct.commands.item.success=§aYou recieved the Construct item! Use it to open the Construct menu. +construct.commands.construct=Gives you the Construct item. Use it to open the Construct menu. +construct.commands.construct.denyorigin=This command can only be used by players. +construct.commands.construct.fail=§cFailed to give you the Construct item. +construct.commands.construct.success=§aYou recieved the Construct item! Use it to open the Construct menu. ## Options construct.option.enabled= is now enabled!