メインコンテンツまでスキップ

dungeon_loot_chest

Dungeon Loot Chest — misc entry.

Entry Information

PropertyValue
Entry IDdungeon_loot_chest
TypeMisc
Color
Icon#FFD700

Description

Represents a single loot item with drop chance and quantity range. / data class LootItem( @Help("The item to drop") val item: Item = SerializedItem(ItemStack(Material.DIAMOND)), @Help("Chance to appear in the chest (0-100%)") val dropChance: Double = 50.0, @Help("Minimum quantity") val minAmount: Int = 1, @Help("Maximum quantity") val maxAmount: Int = 1, @Help("Specific slot in the chest (0-26), or -1 for random slot") val slot: Int = -1 ) /** Valid vanilla storage materials that can be used for loot chests. / private val VALID_STORAGE_MATERIALS = setOf( Material.CHEST, Material.TRAPPED_CHEST, Material.BARREL, Material.SHULKER_BOX, Material.DISPENSER, Material.DROPPER, Material.HOPPER ) /** Determines how a dungeon loot chest is triggered. / enum class ChestPlacementType { /* A real or virtual block is placed at [DungeonLootChestEntry.location]. / BLOCK, /* No block is placed. Instead, any entity (from Entity, BetterModel, ModelEngine, MythicMobs NPC extensions…) found within [DungeonChestManager.NPC_CHEST_RADIUS] blocks of [DungeonLootChestEntry.location] will open this chest on right-click. Place the NPC at or very near the configured location in the template world. / NPC, } /** Entry for defining loot chests in dungeon instances. Chests are placed and filled with random loot when the instance world is generated.

Fields

FieldTypeDescription
dungeonInstanceRef<DungeonInstanceEntry>The dungeon instance this chest belongs to
locationWorldLocationLocation of the chest (or NPC anchor point) in the instance world
placementTypeChestPlacementTypeBLOCK: place a block at the location. NPC: intercept right-click on any entity near the location.
storageItemItemEngine Item representing the block (CraftEngine custom blocks supported). BLOCK mode only.
containerTitleStringCustom title for the storage container (MiniMessage, leave empty for default)
lootTableList<LootItem>List of possible loot items
placementDelayIntDelay in seconds before placing/registering the chest (allows world loading)
replaceExistingBooleanReplace any existing block at the location (BLOCK mode only)
clientSideBooleanVirtual client-side block only — no server-side container. Ignored in NPC mode.
interactionModeDungeonChestManager.ChestInteractionModeInteraction mode: LOOT (virtual inventory) or ACTIONS (execute triggers)
onInteractList<Ref<TriggerableEntry>>Triggers executed on click (ACTIONS mode only)
disappearAfterInteractBooleanIf true, the chest disappears for the player after interaction
manualModeBooleanIf true, the chest is NOT auto-placed. Use DungeonActivateChestActionEntry to spawn it on demand.

Usage Example

- entry: dungeon_loot_chest
name: "Dungeon Loot Chest"
dungeonInstance: ""
location: ""
placementType: ""
storageItem: ""
containerTitle: ""
lootTable: []
placementDelay: 0
replaceExisting: false
clientSide: false
interactionMode: 0
onInteract: []
disappearAfterInteract: false
manualMode: false