📪Creating a custom template

This page is only shown you the way to create a template for a lootchest type, this mean if there is multiple lootchest type, there should be multiple template like this in 1 template file!

I. OVERVIEW

Below is an example for you!


Template Structure

A template consists of the following main sections:

  • settings → General settings for the loot chest.

  • buttons → Buttons for interaction and animations.

  • rewards-location → Locations where rewards will appear.


Material list: here Sound list: here Note: the usable part is the enum name (e.g. ACACIA_BOAT)


1. General Settings (settings)

settings:
  player-location: world, 182.5, 70, 196.3, 180, 0
  location: world, 182.5, 73.2, 193.5
  rotations:
    '1':
      position: "HEAD"
      value: 0, 45, 0
  decoration:
    location: world, 182.21, 74.3, 193.570
    rotations:
      '1':
        position: "RIGHT_ARM"
        value: 90, 90, 0
  click-to-open: false

Explanation:

  • player-location → The player's position when interacting with the loot chest. (This will be the main position of this template for this lootchest type)

  • location → The main location of the loot chest.

  • rotations → Defines how the chest rotates at specific positions

  • decoration → Additional objects of this chest. (built-in objects)

  • click-to-open → Determines if the chest opens when clicked.


2. Configuring Buttons (buttons)

Explanation:

  • location → The button’s position.

  • icon → Defines the material and texture for the button (e.g., PLAYER_HEAD).

  • click-sound / hover-sound → Sounds when clicking or hovering over the button.

  • name → Defines the button's display name, with options for visibility, dynamic colors, and refresh interval.

  • delay → Delay before the button would be spawned after the session start.

  • permission → Required permission to interact with this button.

  • holding-icon→ Set this to false to hide the icon of this button

  • rotate-on-spawn → Determines if the button rotates when it spawns. (if this option enable, the yaw above will be the initial yaw, and it will spin to the final yaw)

  • actions → Defines what happens when the button is clicked .


3. Adding Rewards Locations (rewards-location)

Explanation:

  • Defines where rewards will appear when a player opens a loot chest.

  • Each entry consists of a world, x, y, z coordinates, and optional rotation (yaw, pitch).


4. Additional Customization Options

Child Elements (Sub-Buttons)

Child Elements add some visual effects to the button, it has no execution and always rely on its parent. Here is some available options for a sub-button:

  • Location

  • Name

  • Icon

  • Rotations

Example:

  • location-offset → Defines the position relative to the parent button.

  • display-name → The name of this child.

This is just the overview, if you want further information please go to next part!

II. Details


1. Location

HLootChest provides 2 location modes: location and location-offset

You can set the exactly location using this mode. Example: location: world, 182.5, 73.2, 193.5

2. Rotations

With this option, you can determine the rotation of the Armorstand.

There are different rotation modes:

  • HEAD

  • BODY

  • RIGHT_ARM

  • LEFT_ARM

  • RIGHT_LEG

  • LEFT_LEG

You can set the rotation for almost all elements (box, buttons, sub-buttons) Example:

3. Icon

HLootChest provides two icon displaying mode: static and dynamic

Use this option for performance purpose! Example:

4. Name

Same with Icon, HLootChest provides two name displaying mode: static and dynamic

Use this option for performance purpose! Note: If you use this mode, it is necessary to put name in a line (not a list!) Example:

5. Actions

With this option, you can set the actions will be called on button click

There are some action tags:

  • [player]: execute player's command (PlaceholderAPI Support!).

  • [console]: execute console command.

  • [message]: send message to player.

  • [close]: leave lootchest opening.

6. Requirements

Every button has 2 requirements: spawn-requirements and click-requirements

Example:

There is 8 requirement types:

  • has-permission

  • string-equals

  • >=

  • >

  • ==

  • <

  • <=

  • !=

Last updated