1. Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Script skWorth 1.3

Create an Essentials "/buy" command letting players buy in-game items using the "worth.yml" file!

  1. TobyMinceraft
    Contributors:
    Phineapoo
    Supported Minecraft Versions:
    • 1.13, 1.14, 1.15, 1.16
    skWorth by TobyMinceraft

    NOTE
    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")
    Required Plugins
    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 values from the worth.yml file
    - NOTE: This script has an option to enable/disable 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 read .yml values
    - 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 (currently) allow you to set an item's worth using an in-game command. If you want that feature, use the Essentials/EssentialsX plugins. This script automatically detects the worth file generated by Essentials, so all you'd need to do is move your file to the Essentials folder.
    2) Please note: if you can sell an item on your server, (using this script) you can buy it - it is (currently) not possible to make certain items in the worth 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 have a tutorial per-say, but the config and options are described more in-depth on the wiki.

    Final Note
    Though this skript is made to work with 1.15 and 1.14, this should work with versions lower, just make sure of the following:
    - The version of Skript you are using works with your server version
    - 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 (if using Essentials/EssentialsX) you are using works with your server version

Recent Reviews

  1. MrNygus
    MrNygus
    5/5,
    Version: 1.3
    Do you have worth.yml with all items and blocks to 1.16.2?
    1. TobyMinceraft
      Author's Response
      First, I'll answer the question: no. All this script does is hook into the one you use with plugins such as Essentials/EssentialsX.
      For future reference, please use the "Discussions" tab to ask questions or report issues: https://forums.skunity.com/threads/skworth.11490/