Effects
Effects are things that are triggered by actions such as opening a crate. The available types are:
FireworkEffect
An effect that launches a firework when given.
- WARNING: Firework explosions can damage players in survival - you should ensure the user is protected from damage and/or spawn the firework above the crate so the player is not in range of the explosion.
<id> = {
firework = {
shape = "<firework-shape>"
colors = [<Integer>...]
fades = [<Integer>...]
trail = true/false
flicker = true/false
duration = <Integer>
}
}
If only the shape
needs to be specified, prefer using an inline
reference instead of defining a new effect.
Properties
Name | Type | Description | Default |
---|---|---|---|
shape | FireworkShape | The shape of the firework ("ball" /"large_ball" /"burst" /"star" /"creeper" ) | Random |
colors | List | The colors the firework has initially (RGB) | Random (1-2 colors) |
fades | List | The colors the firework fades into (RGB) | Random (0-1 colors) |
trail | Boolean | Whether the firework leaves a trail | Random |
flicker | Boolean | Whether the firework has a flicker | Random |
duration | Integer | The duration of the firework flight | Random (1-3) |
target | "player" /"location" | The first part of the reference value, whether the initial position is at the player or crate location | "location" |
offset | Vector3d | The second part of the reference value, the xyz offset from the initial position | [0.0, 0.0, 0.0] |
Referencing
The reference value of a firework is its spawn position, which consists of a
target
(the initial position) and offset
(xyz offset for the position):
effects = [
["<firework-id>"]
["<firework-id>", "player"]
["<firework-id>", 0.0, 2.0, 0.0]
["<firework-id>", "player", 0.0, 2.0, 0.0]
{
firework = ...
target = "player"/"location"
offset = [x, y, z]
}
]
If only the shape
needs to be specified, prefer an inline reference instead
of defining a new effect. Additionally, "firework"
can be used for a random
shape.
effects = [
["firework"] //random shape
["firework/<shape>"]
]
Examples
A green creeper firework with a random trail
/flicker
/duration
.
green-creeper = {
firework = {
shape = "creeper"
colors = [0x00FF00]
fades = []
}
}
A burst firework with random colors, fades, etc. that spawns above the player.
effects = [
["firework/burst", "player", 0.0, 2.0, 0.0]
]
ParticleEffect
An effect that runs a particle effect when given. Particle effects are generally
only used as idle
effects as an explicit duration cannot yet be customized.
<id> = {
particle = {
type = "<particle-type>"
color = <Integer>
}
path = {
type = "circle"/"helix"/"spiral"/"vortex"
axis = [x, y, z] (circle only)
interval = <Integer>
precision = <Integer>
segments = <Integer>
shift = <Decimal>
speed = <Decimal>
scale = [x, y, z]
}
}
If only the particle
/path
type needs to be specified, prefer setting it
directly which will use the default values for the other properties.
<id> = {
particle = "<particle-type>"
path = "circle"/"helix"/"spiral"/"vortex"
}
Properties
Name | Type | Description | Default |
---|---|---|---|
type | ParticleType | The particle type | Required |
color | Integer | The particle color (only for minecraft:redstone_dust ) | Rainbow |
type | "circle" /"helix" /"spiral" /"vortex" | The path type | Required |
axis | Vector3d | The rotation axis (only for circle paths) | [0.0, 1.0, 0.0] |
interval | Integer | The interval between animation updates (in milliseconds) | 20 |
precision | Integer | The number of available points along the path | 120 |
segments | Integer | The number of individual particles being animated | 1 |
shift | Decimal | The initial time offset of the animation for path calculations | 0.0 |
speed | Decimal | The relative speed of the animation compared to the precision | 1.0 |
scale | Vector3d | The relative scale of the animation | [1.0, 1.0, 1.0] |
target | "player" /"location" | The first part of the reference value, whether the initial position is at the player or crate location | "location" |
offset | Vector3d | The second part of the reference value, the xyz offset from the initial position | [0.0, 0.0, 0.0] |
Referencing
The reference value of a potion is its duration, which is in seconds.
effects = [
["<potion-id>", 10]
{
potion = ...
duration = Integer
}
]
Unlike most other effects, particles cannot be defined as an inline reference as they often require further customization for many use cases.
Examples
A rainbow helix particle with 3
segments.
rainbow-helix = {
particle = "minecraft:redstone_dust"
path = {
type = "helix"
segments = 3
}
}
A particle that produces 8
pillars of enchantment glyphs.
effects = {
idle = [
{
particle = "minecraft:enchanting_glyphs"
path = {
type = "circle"
segments = 8
shift = 0.3925
speed = 0.0
scale = [1.5, 1.0, 1.5]
}
offset = [0.0, 0.75, 0.0]
}
]
}
effects = [
["minecraft:regeneration/2", 10]
]
PotionEffect
An effect that gives the player a potion effect when given.
<id> = {
potion = {
type = "<potion-type>/<strength>"
ambient = true/false
particles = true/false
}
}
If only the type
needs to be specified, prefer using an inline
reference instead of defining a new effect.
Properties
Name | Type | Description | Default |
---|---|---|---|
type | PotionType | The potion type, which consists of an effect id and optionally a strength (ex. minecraft:regeneration/2 for Regeneration II) | Required |
ambient | Boolean | Whether the effect is ambient, meaning it is displayed less prominently (normally used for beacon effects) | false |
particles | Boolean | Whether the effect shows particles | true |
duration | Integer | The reference value, which is the duration of the effect in seconds | Required |
Referencing
The reference value of a potion is its duration, which is in seconds.
effects = [
["<potion-id>", 10]
{
potion = ...
duration = Integer
}
]
If only the type
needs to be specified, prefer an inline reference instead of
defining a new effect.
effects = [
["minecraft:regeneration/2"]
]
Examples
A Night Vision effect that is ambient and hides particles.
secret-night-vision = {
potion = {
type = "minecraft:night_vision"
ambient = true
particles = false
}
}
A Regeneration II effect that lasts 10
seconds.
effects = [
["minecraft:regeneration/2", 10]
]
SoundEffect
An effect that plays a sound when given.
<id> = {
sound = {
type = "<sound-type>"
volume = <Decimal>
pitch = <Decimal>
}
}
If only the type
needs to be specified, prefer using an inline
reference instead of defining a new effect.
Properties
Name | Type | Description | Default |
---|---|---|---|
type | SoundType | The type of the sound | Required |
volume | Decimal | The volume of the sound | 1.0 |
pitch | Decimal | The pitch of the sound | 1.0 |
target | "player" /"location" | The first part of the reference value, whether the initial position is at the player or crate location | "location" |
offset | Vector3d | The second part of the reference value, the xyz offset from the initial position | [0.0, 0.0, 0.0] |
Referencing
The reference value of a sound is its position, which consists of a target
(the initial position) and offset
(xyz offset for the position):
effects = [
["<sound-id>"]
["<sound-id>", "player"]
["<sound-id>", 0.0, 2.0, 0.0]
["<sound-id>", "player", 0.0, 2.0, 0.0]
{
sound = ...
target = "player"/"location"
offset = [x, y, z]
}
]
If only the type
needs to be specified, prefer an inline reference instead of
defining a new effect.
effects = [
["minecraft:block_note_bell"]
]
Examples
An explosion sound that plays twice as loud.
loud-explosion = {
sound = {
type = "minecraft:entity_generic_explode"
volume = 2.0
}
}
A bell sound from a note block that plays above the player.
effects = [
["minecraft:block_note_bell", "player", 0.0, 2.0, 0.0]
]