Skip to content

Command Signs

Ryandw11 edited this page Mar 19, 2023 · 2 revisions

Command Signs allow you to execute commands when a structure is spawned in. The benefit of using signs is that you can have something happen at a specific location within the structure. Command Signs don't execute individual commands, instead they execute what are known as Command Groups.

Command groups are created in the signcommands.yml file within the CustomStructures folder.

Command Groups Configuration

SaySomething:
  - "say Sign coordinate: <x>,<y>,<z>"
  - "say Structure coordinate one: <structX1>,<structY1>,<structZ1>"
  - "say Structure coordinate two: <structX2>,<structY2>,<structZ2>"

The SaySomething is the name of the command group. The list below it has the commands that the console will execute when the structure spawns.

Placeholders

You can put placeholders into the commands:

<world>       -- The name of the world where the structure spawned.
<x>           -- The x location of the sign. 
<y>           -- The y location of the sign.
<z>           -- The z location of the sign.
<minX>        -- The minimum x location of the structure.
<minY>        -- The minimum y location of the structure.
<minZ>        -- The minimum z location of the structure.
<maxX>        -- The maximum x location of the structure.
<maxY>        -- The maximum y location of the structure.
<maxZ>        -- The maximum z location of the structure.
<uuid>        -- A random UUID.
<structName>  -- The name of the spawned structure.

Adding a Command Group to a Structure

Put down a sign anywhere within the structure that has [command] on the first line and the command group name on the second line.

[command]
<group_name>

Example:

[command]
SaySomething

Examples

Protecting a structure with WorldGuard

Here is an example that protects a structure using world guard.

ProtectStructure:
  - '/world <world>'
  - '/pos1 <minX>,<minY>,<minZ>'
  - '/pos2 <maxX>,<maxY>,<maxZ>'
  - 'rg -w <world> define <uuid>'