main/Documentation/Effects Configuration

When player opens a box, plugin can perform some actions (like launch a firework, play sound sound or broadcast a message).

These actions are called 'effects' and are configured in a box config in a section with the same name.

'effects' section can has 4 sub-sections, each describing one of events: 'open' (when gui opens), 'move' (when items in gui have been moved), 'drop' (when gui stops, or player gets items from a box which does not have a gui), 'close' (when player closes gui).

Effect Format

Effect is a section that contains 3 keys (all are optional):

'firework' Section

Here is described a firework that will be launched when event happens.

'type' String

Required

Type of the firework: BALL, BALL_LARGE, STAR, BURST, CREEPER.

'colors' List of Strings

Required

List of Strings, each representing one of firework's colors. Color can be specified by two ways -- by name or RGB HEX value (like in HTML, #123abc).

Valid color names: WHITE, SILVER, GRAY, BLACK, RED, MAROON, YELLOW, OLIVE, LIME, GREEN, AQUA, TEAL, BLUE, NAVY, FUCHSIA, PURPLE, ORANGE.

'fadeColors' List of Strings

Fade colors of the firework. Format is identical to the 'colors'.

'flicker'

If set to true, firework will have the twinkle effect.

'trail'

If set to true, firework will leave behind a trail of particles.

'power' Number

Power of the firework determines length of its flight. If set to -1, firework will explode instantly.

Default value is -1.

'sound' Section

Here is described a sound that will be played to player when event happens.

'sound' String

Required

Determines the sound type. All available sounds are listed here: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Sound.html

Sound ids were changed in 1.13, page above contains only 1.13+ ids.

'volume' Number

Determines volume of the sound, default value is 1.0. The more value is, the more will be volume of the sound.

'pitch' Number

Determines pitch of the sound, default value is 1.0. The more pitch is, the shorter will be sound and the higher will be its frequency.

'broadcast' String

This string will be sent to all online players when event will happen. Can be colored using '&' character.

It can contain these placeholders:

  • %player% -- will be replaced with the nick of the player.
  • %box% -- will be replaced with name of the box, and when player hovers on it in the chat, he will see a text identical to the text, that appears when player hovers on a box in the inventory.

Example

effects:
  open:
    # Red-green-blue firework, fades in gray and black. Flies up some time.
    firework:
      type: BALL_LARGE
      colors: ['#FF0000', '#00FF00', 'BLUE']
      fadeColors: ['GRAY', 'BLACK']
      flicker: true
      power: 1
      
    # Chest open sound
    sound: {sound: CHEST_OPEN}
    
    # Message about box being opened
    broadcast: '&ePlayer &6%player% &eopens %box% &eright now!'
  move:
    # Button click sound
    sound: {sound: CLICK}
  drop:
    # Anvil land sound
    sound: {sound: ANVIL_LAND}
    
    # Instant red star
    firework:
      type: STAR
      colors: ['RED']
  close:
    # Chest close sound
    sound: {sound: CHEST_CLOSE}

Comments

Posts Quoted:
Reply
Clear All Quotes