module dismantle - magemonkeystudio/divinity GitHub Wiki
The Dismantle Module allows players to destroy items in exchange for rewards like materials, money, or commands. This system supports gear recycling, item economy balancing, and crafting loops.
Dismantling involves:
-
A dismantle tool item
โ Located in:plugins/Divinity/modules/dismantle/items
-
A matching dismantle source file
โ Located in:plugins/Divinity/modules/dismantle/source
Both must be configured โ tools won't function without matching sources.
material: SHEARS
name: Armor Dismantle Tool
tier: common
item-flags:
- '*'
uses-by-level:
'1': 1
'2': 2
'3': 3
level:
min: 1
max: 3
target-requirements:
type:
- ARMOR
level:
'1': 1
module:
- '*'
This defines a dismantle item usable only on armor-type targets with at least level 1.
Dismantle sources define:
- Input module
- Accepted item IDs/levels
- Output rewards
- Preview display
- Optional cost (e.g., XP)
Example file:
input-module: gems
output-by-item-id-level:
default:
'1':
cost: 15
output:
emeralds:
chance: 10.0
item:
material: EMERALD
amount: 17
name: '&aEmerald'
preview:
material: EMERALD
amount: 17
name: '&aEmerald &7(10%)'
sulphur:
chance: 100.0
item:
material: GUNPOWDER
preview:
material: GUNPOWDER
name: '&8Sulphur &7(100%)'
nugget:
chance: 15.0
commands:
- '[CONSOLE] eco give %player% 10'
preview:
material: GOLD_NUGGET
name: '&e10$ &7(15%)'
-
item:
โ Vanilla item with material, amount, and custom name/lore -
commands:
โ Execute server commands like giving money, buffs, or custom drops
You can mix both in one reward entry.
Players see all possible rewards in the GUI preview, but only those that pass their chance:
roll are granted.
Tips:
- Use
&7(15%)
format in preview names - Explain mechanics via lore/tutorial signs
Command | Description | Permission |
---|---|---|
/dismantle help |
Show help page | divinity.dismantle.help |
/dismantle open [player] [force:true/false] |
Open GUI (optionally force another player) | divinity.dismantle.open |
/dismantle get <id> [level] [amount] |
Get a dismantle item | divinity.dismantle.get |
/dismantle give <player> <id> [level] [amount] |
Give item to a player | divinity.dismantle.give |
/dismantle drop <world> <x> <y> <z> <id> [level] [amount] |
Drop a dismantle item at coordinates | divinity.dismantle.drop |
/dismantle list [page] |
View registered dismantle items | divinity.dismantle.list |
/dismantle reload |
Reload the module | divinity.dismantle.reload |
- Use
target-requirements
to limit dismantling by type, level, or module - Add lore to dismantle tools to teach players how they work
- Pair with modules like
loot
,crafting
,essence
, andworth
for deep systems