- Contributors
- Phineapoo
- Supported Skript Version
- 2.4
skWorth by TobyMinceraft
NOTICE
Almost everything you see here is described more in-depth on my "wiki" located on my website: https://tmcmedia.risingdawn.fun/projects/skript-buy-command
Description
A simple script which gives server owners a customizable "/buy" command for players. This allows you to sell ALL vanilla Minecraft items on your server, so long as you have previously set them in your Essentials (or custom) worth.yml file (does not support custom items)
Customization
Almost everything in this skript can be customized, up to a point. You may alter messages to your liking, but they are concealed in the code and may corrupt things if you're not careful! Some configurable options include:
- Location of worth.yml file, if different than Essentials'
- Internal name of cache (used by skript-yaml, in case another yaml-based script uses the same name)
- Chat prefix for messages used by this script (not messages sent to console)
- Player balance type (not to be confused with money type); this is as simple as "player's balance", "player's level" (xp levels) or your own Skript variable such as {balance::%player's uuid%} (this script does not create its own balance variable - use your own!)
- And more! (all of these explained on the "wiki")
Skript (duh)
https://github.com/SkriptLang/Skript/releases
- If you don't have Skript, you can't use this script!
skript-yaml
https://github.com/Sashie/skript-yaml/releases
- Used to read .yml files
- NOTE: This script has an option to control usage of skript-yaml, as some server hosts do not yet provide this plugin (I'm looking at you, Aternos).
SkQuery
https://github.com/SkQuery/SkQuery/releases
- Used to locate your worth.yml file and necessary plugins' config files
- Needed for some script code
Optional Plugins
Essentials / EssentialsX
https://www.spigotmc.org/resources/essentialsx.9089/
- If you want to set an item's worth value using an in-game command, you must install Essentials/EssentialsX; this plugin also comes with it's own economy!
Vault
https://dev.bukkit.org/projects/vault
- Required by Essentials/EssentialsX and most economy plugins
- Required if you wish to use "player's balance" as the script's player balance manager
Tested Plugin / Server Versions
Skript = v2.4.1
- Minimum required version: unknown
skript-yaml = v1.3.2
- Minimum required version: v1.2.1
SkQuery = v3.6.5
- Minimum required version: v3.6.2
Spigot/Paper = git-Paper-162 (MC: 1.15.2)
IMPORTANT NOTICE
1) This script does NOT allow you to set an item's worth using an in-game command. If you want that feature, use the Essentials/EssentialsX plugin(s). This script automatically detects the file generated by Essentials, so all you need to do is move your file into plugins/Essentials folder, if not already there
2) If you can sell an item, using this script you can buy it - it is currently not possible to make certain items in the file to not be purchasable. If I get enough people to suggest it, I may add it as a feature later.
3) I do not have a custom worth.yml file for you to use with all of the items...just do a quick google search, and you can *probably* find one. I did, however, find one updated to 1.14 that has already been optimized with a lot of the "exploits" patched; you can find it on GitHub <= click here
4) DO NOT use the reviews section to post bugs, talk about this script, or request features. Instead, post them in the "Discussions" tab so that way anyone with an answer may respond to your request should they see it before I do.
5) This script is NOT a standalone player balance management system. Create your own or find one, or use the Essentials plugin or any other Vault-compatible economy plugin.
How This Script Works
There's a few steps involved to getting this script to load properly, but here's the gist of what happens:
1) The script checks to see if you are using the player's balance or a custom Skript variable
2) If using player's balance, the script then checks to see if Vault is running (by locating the config); if Vault cannot be found, script disables itself
3) The script checks to see if the default Essentials worth.yml file is found; if not, locates other file specified in the file location option
4) If all has passed, the script finishes loading and the /buy command is ready for use; if not, the script file will disable itself
Tutorial / Wiki
This script doesn't currently have a tutorial, but the config and options are described more in-depth on the wiki as well as via comments in the script.
FINAL NOTE
This script has been tested in Minecraft versions 1.14 and 1.15; it should work with versions higher/lower, just make sure of the following:
- The version of Skript you are using works with your server version
- The version of Java you have supports both your version of Minecraft AND Skript
- The version of SkQuery you are using works with your server version
- The version of Essentials/EssentialsX you are using works with your server version
- The version of skript-yaml you are using works with your server version
- The version of Vault you are using works with your server version (should be independent of versions, but it is always safe to double-check)
For future reference, please use the "Discussions" tab to ask questions or report issues: https://forums.skunity.com/threads/skworth.11490/