Skip to content

Implement buy command - #6622

Open
superspeed500 wants to merge 6 commits into
EssentialsX:2.xfrom
superspeed500:implement-buy-command
Open

Implement buy command#6622
superspeed500 wants to merge 6 commits into
EssentialsX:2.xfrom
superspeed500:implement-buy-command

Conversation

@superspeed500

@superspeed500 superspeed500 commented Sep 6, 2026

Copy link
Copy Markdown

Information

Implementation of a /buy command in order to be able to buy items from the server. All items that have a value set could be bought from the server. Permission node controlls if a player should be able to buy stuff or not.

This PR closes #2785.

Details

Proposed feature:

Typing /buy <item_name> should allow you to buy that amount of the given item from the server. Money for the items will then be drawn from the player bank account.

The bought items will be dropped if isDropItemsIfFull is enabled in the Essentials config. The item will otherwise be discarded. Money will still be discarded from the player bank account.

Environments tested:

OS: Fedora Linux

Java version: OpenJDK 25.0.4.1

  • Paper version 26.1.2-74-ver/26.1.2@e4e17fc
  • CraftBukkit/Spigot/Paper 1.12.2
  • CraftBukkit 1.8.8

Demonstration:

Bellow is sample commands after trying to buy a total of three gold ingots. The first is bought without problems, while the next two can't be bought (as indicated by no bought command shown in the CLI).

[19:21:37 INFO]: Superspeed500 issued server command: /eco set Superspeed500 700
[19:21:48 INFO]: Superspeed500 issued server command: /buy gold_ingot 1
[19:21:48 INFO]: [Essentials] Superspeed500  bought  gold_ingot for $315 (1 items at $315 each).
[19:21:57 INFO]: Superspeed500 issued server command: /buy gold_ingot 2

@superspeed500 superspeed500 mentioned this pull request Sep 6, 2026
3 tasks
@superspeed500
superspeed500 marked this pull request as ready for review September 6, 2026 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/sell exists but /buy does not?

1 participant