Skip to content

A plugin that allows your players to sell their inventory with a simple command

Notifications You must be signed in to change notification settings

heroslender/HeroVender

Repository files navigation

Heroslender

HeroVender

GitHub stars bStats Servers GitHub All Releases GitHub issues GitHub last commit Codacy Badge Open Source Love

A plugin that allows your players to sell their inventory with a simple command or automatically using shift or when their inventory gets full:

Commands

  • /sell - Sell the inventory
  • /sellmenu - Open the selling menu, that allows the player to activate shift-sell or auto-sell
  • /shiftsell - Toggle the Shift-Sell status
  • /autosell - Toggle the Auto-Sell status
  • /herovender reload - Reload the plugin(configuration and messages)
  • /herovender item - See the ID of the item the player is holding

Permissions

  • herovender.shiftsell - Permission to activate the shift-sell
  • herovender.autosell - Permission to activate the auto-sell

Placeholders

  • :player: - The player name

Sell placeholders

  • :invoice-total: - The total ammount of money the player is receiving for the items
  • :invoice-total-formatted: - The total ammount of money the player is receiving for the items, with prety formatting
  • :invoice-item-count: - The total amount of items the player sold

Delay placeholders

  • :delay: - Time the player has to wait to be able to sell again, in miliseconds
  • :delay-formated: - Time the player has to wait to be able to sell again, in seconds, formated with two decimals

Prices menu placeholders

  • :price: - The unit price of the item
  • :price-formatted: - The unit price of the item, formated with two decimals

Configuration

Default

commands:
  sell:
    name: sell
    aliases:
    - sellall
  herovender:
    name: herovender
    usage: '&bHeroVender &7- &a/herovender <reload>'
# Configure the auto-sell
autosell:
  # Strategy to use for auto-selling, available strategies:
  # https://github.com/heroslender/HeroVender/tree/master/src/main/java/com/heroslender/herovender/autosell/AutoSellStategy.java
  strategy: "PICKUP_ITEM"
  settings:
    # Is it required for the inventory to be full in order to sell?
    require-inventory-full: true
    # If the strategy is set to TIMER, this is the delay to use between checks
    timer-delay: 10
bonus:
  1:
    permission: herovender.vip
    name: VIP bonus
    bonus: 0.08
  2:
    permission: herovender.vip.plus
    name: Bonus VIP+
    bonus: 0.15
delay:
  1:
    permission: herovender.default
    delay: 10000
  2:
    permission: herovender.vip
    delay: 1000
  3:
    permission: herovender.staff
    delay: 0
shops:
  default:
    items:
    - INK_SACK:4 1 price:1000
    - DIAMOND 1 price:1000
    - SLIME_BALL 1 name:&aYour_custom_named_item price:1000
  zombie:
    permission: vender.lapis
    inherits:
    - default
    items:
    - ROTTEN_FLESH 1 price:1500
    - CARROT_ITEM 1 price:5500

Messages

sell:
  sold: '&aYou sold &7:invoice-item-count: &afor &f:invoice-total-formatted:&a!'
  no-items: '&cYou don''t have any items that can be sold!'
  delay: '&cYou must wait :delay-formated: to sell again!'
  menu:
    title: Sell menu!
    sell: DOUBLE_PLANT 1 name:&aSell lore:&7Click_here_to_sell_your_inventory!
    shiftsell:
      no-permission: LEVER 1 name:&aShift-Sell lore:&7Sell_your_inventory_by_sneaking||&7(Insufficient_permissions)
      'on': LEVER 1 name:&aShift-Sell lore:&7Sell_your_inventory_by_sneaking||&7Current_state->_&aActive|&7(Click_to_deactivate)
      'off': LEVER 1 name:&cShift-Sell lore:&7Sell_your_inventory_by_sneaking||&7Current_state->_&cInactive|&7(Click_to_activate)
    autosell:
      no-permission: LEVER 1 name:&aAuto-Sell lore:&7Automatically_sell_your_inventory_when_full.||&7(Insufficient_permissions)
      'on': LEVER 1 name:&aAuto-Sell lore:&7Automatically_sell_your_inventory_when_full.||&7Current_state->_&aActive|&7(Click_to_deactivate)
      'off': LEVER 1 name:&cAuto-Sell lore:&7Automatically_sell_your_inventory_when_full.||&7Current_state->_&cInactive|&7(Click_to_activate)
prices:
  menu:
    title: "Sell Prices"
    item:
      lore:
      - ''
      - "&7Price per unit: &a$&f:price-formatted:"
      - ''
      - ':lore:'

API

To get the plugin instance you can use the HeroVender.getInstance() method. With the plugin instance you can access all controllers and use them.

Maven

<repository>
    <id>heroslender-repo</id>
    <url>https://nexus.heroslender.com/repository/maven-public/</url>
</repository>

<dependency>
    <groupId>com.heroslender</groupId>
    <artifactId>HeroVender</artifactId>
    <version>1.0.0</version>
    <scope>provided</scope>
</dependency>

Events

  • PlayerSellEvent - Called when a player sells their inventory