module sell - magemonkeystudio/divinity GitHub Wiki

πŸ’° Sell Module

The Sell module allows players to quickly sell items through a custom GUI. It supports a configurable interface, permission control, and a command system for opening and managing the sell window.


πŸ“ File Location

plugins/Divinity/modules/sell/settings.yml


🧾 Configuration

command-aliases: sell

gui:
  title: '&4&l<&4&nSelling&4&l>'
  size: 54
  item-slots: 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44
  content:
    filler_yellow:
      material: YELLOW_STAINED_GLASS_PANE
      name: '&7'
      slots: 45,46,52,53
      type: NONE
    filler_orange:
      material: ORANGE_STAINED_GLASS_PANE
      name: '&7'
      slots: 47,51
      type: NONE
    filler_red:
      material: RED_STAINED_GLASS_PANE
      name: '&7'
      slots: 48,50
      type: NONE
    sell:
      material: EMERALD
      skull-hash: ''
      enchanted: false
      name: '&2« &aSell &2»'
      lore:
        - '&eTotal cost:             &6$%cost%'
        - '&8&m                                      '
        - '&7Sell all items in GUI.'
      slots: '49'
      type: ACCEPT

πŸ›’ How Item Prices Are Calculated

Item values are defined in worth.yml. When a player sells an item:

  1. Material Matching
    The item’s material type is matched against entries in worth.yml.

  2. Optional Metadata Matching
    Items can also be matched using optional conditions:

    • Display name (name)
    • Lore (lore)
    • custom-model-data
    • NBT data (nbt)
  3. Value Calculation
    If a match is found, the value is multiplied by the item’s quantity and shown as the total worth.

  4. No Match = $0
    Items not found in worth.yml are not sellable and show no value.

  5. Modifiers
    Additional multipliers may be applied in certain modules (e.g., merchants) depending on configuration.

πŸ‘‰ For full item pricing setup, see: worth.yml


🧾 Commands

Command Description
/sell open [player] [force:true/false] Opens the sell GUI for a player.
/sell help Displays help information.
/sell reload Reloads the Sell module.

πŸ” Permissions

Permission Node Description
divinity.sell.open Required to use /sell open.
divinity.sell.reload Required to reload the module.
divinity.sell.help Required to access help information.
divinity.sell.* Grants access to all Sell commands.

πŸ–ΌοΈ GUI Overview

The sell GUI has 45 item slots (0–44) for players to place items they want to sell. Special colored panes are used to visually segment the interface:

  • Yellow – Corners and sides (decorative filler).
  • Orange – Outer edge.
  • Red – Outer edge.
  • Emerald – Center slot (49), used to finalize the sale and show total sell value.

πŸ”— Back to Modules

← Return to Modules List