Skip to content

Creating a Wardrobe Zone

A wardrobe zone is a physical area in your world that, when entered, puts a player into a special customization mode. Their camera becomes fixed in one spot, and their own NPC appears in front of them, on which they can try on various cosmetics in real-time.

This is a powerful tool for creating interactive and beautiful fitting rooms on your server.

Required Permissions

To create and manage zones, you will need the permission: ecosmetics.zones.

Step-by-Step Guide

Creating a zone involves several stages, from defining its boundaries to configuring the placement of the NPC and camera.

Step 1: Create the Zone Configuration

First, you need to create a new zone.

Execute the command:

sh
/ecosmetics zones add <zone_name>

For example: /ecosmetics zones add main_lobby

Step 2: Define the Zone Boundaries

Now you need to specify the physical boundaries of the zone. When a player enters this area, they will be placed in the wardrobe. A special tool, the "selection wand," is used for this.

  1. Get the wand:

    sh
    /ecosmetics zones givecorns <zone_name>

    You will receive a Blaze Rod in your inventory.

  2. Select the area:

    • Left-click on a block in one corner of the future zone (the first point).
    • Right-click on a block in the opposite diagonal corner (the second point).

You have now created a cuboid region that will act as the trigger for entering the wardrobe.

Step 3: Set the View Point (Camera)

This is one of the most important settings. You need to stand in the spot from which the player will look at their NPC and aim your camera in the desired direction.

Execute the command:

sh
/ecosmetics zones setcam <zone_name>

This command will save your current location and the direction you are looking as the viewpoint for all players entering this zone.

Step 4: Set the NPC Location

Now, determine where the player's NPC will appear. Stand in the spot where the NPC should be and look in the direction it should face.

Execute the command:

sh
/ecosmetics zones setnpc <zone_name>

Step 5: Set the Exit Point

Specify the location where the player will be teleported after leaving the wardrobe. It is recommended to set this point slightly outside the physical boundaries of the zone to avoid accidental re-entry.

Stand at the desired point and execute the command:

sh
/ecosmetics zones setexit <zone_name>

Step 6: Configure Preview Points (Optional)

You can set specific locations for previewing balloons and sprays.

  • For balloons: Stand at the point where the balloon should appear (for example, to the side of the NPC).
    sh
    /ecosmetics zones setballoon <zone_name>
  • For sprays: Look at the block where you want to apply the spray and execute the command. It will automatically save the block and the face you are looking at.
    sh
    /ecosmetics zones setspray <zone_name>

Step 7: Save the Zone

After you have configured all the necessary points, save the zone's configuration. This will write all the set coordinates to the zones.yml file.

sh
/ecosmetics zones save <zone_name>

Attention!

Do not skip this step! Without saving, all your settings will be lost after a server restart.

Step 8: Activate the Zone

By default, a newly created zone is inactive. To allow players to use it, you must enable it.

sh
/ecosmetics zones enable <zone_name>```

:::danger IMPORTANT!
If you want the zone to always be enabled, you must run the following command again after initially activating the wardrobe:
```sh
/ecosmetics zones enable <zone_name>

:::

Your wardrobe zone is now fully operational!

Managing Zones

Here are a few additional commands for managing zones:

CommandDescription
/ecosmetics zones disable <name>Temporarily disables a zone without deleting it.
/ecosmetics zones remove <name>Completely deletes a zone and its configuration.

The zones.yml File

After saving, your configuration will look something like this in the plugins/ECosmetics/zones.yml file:

yaml
zones:
  main_lobby:
    name: main_lobby
    corn1: world,100,64,100 # First selection point
    corn2: world,110,70,110 # Second selection point
    npc: world,105.5,65.0,103.5,180.0,0.0 # NPC coordinates and rotation
    enter: world,105.5,66.5,108.5,180.0,0.0 # Camera coordinates and rotation
    exit: world,105.5,65.0,111.5,180.0,0.0 # Exit point coordinates and rotation
    balloon: world,107.5,66.0,103.5,0.0,0.0 # Balloon coordinates
    spray:
      loc: world,102.0,66.0,105.0 # Spray block coordinates
      face: EAST # Block face
    enabled: true # Zone status (enabled/disabled)