Loot Chest Trigger
Loot Chest Trigger
Action entry that manually triggers a specific loot chest on demand. Use this in combination with a [DungeonLootChestEntry] that has [DungeonLootChestEntry.manualMode] set to true. When this action is executed (e.g., via command, trigger, or another entry), it spawns the configured loot chest at its defined location, in the world of the player's run.
Champs
| Champ | Type | Par défaut | Description | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
chestEntry | Ref<DungeonLootChestEntry> | — | The DungeonLootChestEntry to trigger on execution. | ||||||||||||||||||||||||||||||||||||||||
triggerMode | TriggerMode | ONCE | How often this trigger may place its chest. ONCE (the default): once per run, the other firings of the same run are ignored and the next run starts clean. REPEATABLE: every time it fires. CONDITIONAL: only when the Trigger criteria are met. | ||||||||||||||||||||||||||||||||||||||||
triggerCriteria | List<Criteria> | empty | Criteria checked when triggerMode is CONDITIONAL. All must pass. | ||||||||||||||||||||||||||||||||||||||||
triggerSound | String | — | Sound played to the players of the run when the chest appears (e.g., ENTITY_ENDERMAN_TELEPORT). Leave empty for no sound. | ||||||||||||||||||||||||||||||||||||||||
triggerSoundVolume | Float | 1.0 | Volume of the sound, where 1 is the normal volume of a sound. | ||||||||||||||||||||||||||||||||||||||||
triggerSoundPitch | Float | 1.0 | Pitch of the sound, where 1 is the normal pitch (lower is deeper, higher is shriller). | ||||||||||||||||||||||||||||||||||||||||
triggerDelay | Int | 0 | Delay in ticks before the chest appears after triggering (0 = instant). | ||||||||||||||||||||||||||||||||||||||||
particleEffect | DungeonParticle | — | Particle effect shown at each chest, to the players of the run, when it appears. Leave the particle empty for none. When it names a particle it replaces the four legacy particle fields below.
|
| Champ | Type | Par défaut | Description |
|---|---|---|---|
particle | String | — | Name of the particle, for example FLAME, HAPPY_VILLAGER or END_ROD. Empty = no particle. A particle that needs extra data (dust, a block, an item) is refused, and the server log says so once. |
count | Int | 30 | How many particles are shown each time. |
offsetX | Double | 0.5 | How far, in blocks, the particles spread from the centre along the X axis. |
offsetY | Double | 0.5 | How far, in blocks, the particles spread from the centre along the Y axis. |
offsetZ | Double | 0.5 | How far, in blocks, the particles spread from the centre along the Z axis. |
speed | Double | 0.1 | Speed (or extra data) of the particles; what it does depends on the particle. |
centerX | Double | 0.5 | Shifts the centre of the effect along the X axis, in blocks, from the spot (0.5 = the middle of a block). |
centerY | Double | 0.5 | Shifts the centre of the effect along the Y axis, in blocks, from the spot (0.5 = the middle of a block). |
centerZ | Double | 0.5 | Shifts the centre of the effect along the Z axis, in blocks, from the spot (0.5 = the middle of a block). |
triggerParticleStringtriggerParticleCountInt30triggerParticleSpreadDouble0.5triggerParticleSpeedDouble0.1broadcastMessageStringChamps TypeWriter communs (criteria, modifiers, triggers)
| Champ | Type | Par défaut | Description |
|---|---|---|---|
criteria | List<Criteria> | empty | — |
modifiers | List<Modifier> | empty | — |
triggers | List<Ref<TriggerableEntry>> | empty | — |
How to use it
Places a loot chest on demand. The target Dungeon Loot Chest must have manualMode on, otherwise the player is told the chest is not configured for manual triggering.
| Field | What to know |
|---|---|
triggerMode | ONCE (default) works once per run: later triggers in the same run are ignored and the next run starts clean. REPEATABLE works every time. CONDITIONAL works when all triggerCriteria match. |
triggerCriteria | Used by CONDITIONAL only. |
triggerSound | Sound played to the players of the run when the chest appears, for example ENTITY_ENDERMAN_TELEPORT. Empty for none. |
triggerSoundVolume, triggerSoundPitch | Volume and pitch of that sound. Default 1 and 1 (normal). Minimum 0. |
triggerParticle | Particle shown at the chest, to the players of the run, when it appears. Empty for none. |
triggerParticleCount, triggerParticleSpread, triggerParticleSpeed | How many particles (default 30, minimum 1), how far in blocks they spread from the centre of the chest along each axis (default 0.5), and their speed or extra data (default 0.1; what it does depends on the particle). |
broadcastMessage | Message sent to the players of the run when the chest appears. {player} is the player who triggered it and {chest} the chest name. Colour codes are accepted. Empty for no message. |
triggerDelay | Delay in ticks before the chest appears. 0 is instant. |
The chest is placed in the world of the run of the player who triggered it.
Particle effect
particleEffect replaces the four old particle fields. Set particle (for example FLAME, HAPPY_VILLAGER or END_ROD; empty = none), then count (default 30), offsetX, offsetY and offsetZ (spread on each axis, default 0.5), speed (default 0.1) and centerX, centerY and centerZ (shift of the centre from the position of the chest; 0.5 is the middle of the block). Particles that need data (dust, block, item) are refused and logged once. The effect is shown to the players of the run at each chest of the entry (see additionalLocations of the Dungeon Loot Chest); the sound plays once.
triggerParticle, triggerParticleCount, triggerParticleSpread and triggerParticleSpeed are legacy. They are used only when particleEffect.particle is empty, and the spread then applies to the three axes around the middle of the block. Existing pages keep working unchanged.