Back to 9Minecraft
Wiki 9Minecraft Wiki 9Minecraft

Skript Plugin FAQ

10 questions players actually ask, answered.

How do I create my first Skript script?
Create a new .sk file in your server's scripts folder, write your code using Skript syntax, then reload scripts with /reload skript or restart your server. Skript will automatically load and parse any valid .sk files in that directory.
What's the difference between 'on' and 'every' in Skript?
'on' triggers when an event happens (like a player breaking a block), while 'every' runs repeatedly at set intervals (like every 5 seconds). Use 'on' for reactive events and 'every' for continuous loops.
How do I check if a player has a specific item in their inventory?
Use the condition 'player has [item]' to check if an item exists in their inventory. For example: 'if player has diamond sword' will return true or false depending on what they're carrying.
Why isn't my script working after I edited it?
Use /reload skript to reload your scripts without restarting the server, or check the server console for syntax errors that Skript reports when parsing your file. Make sure your indentation is correct—Skript uses indentation to define code blocks.
Can I use Skript with other plugins?
Yes, Skript is designed to work alongside other plugins. Some addons extend Skript to hook into popular plugins, but Skript itself is compatible with most Paper/Spigot plugins out of the box.
How do I store information that persists after server restart?
Use variables with the save flag (like 'set {saved_data} to value') or integrate with a database addon. Simple variables reset on restart unless you explicitly save them to a file or external storage.
What's the best way to prevent command spam or abuse?
Combine cooldown variables with timestamps to track when a player last used a command, then check if enough time has passed before allowing them to use it again. Store the cooldown in a variable tied to the player's UUID.
Can Skript handle complex math or string manipulation?
Yes, Skript supports mathematical operations, string functions, and list manipulation. You can perform calculations, concatenate text, and work with collections of data using built-in expressions.
How do I make a script that only works for certain players or ranks?
Check player permissions using 'if player has permission "permission.name"' or check for specific players by UUID/name before executing the action. Most servers integrate Skript with permission plugins for role-based access.
Will running lots of Skript scripts slow down my server?
Poorly written scripts with inefficient loops or constant checks can impact performance, but Skript itself is lightweight. Avoid running expensive operations every tick, use cooldowns wisely, and test your scripts for lag before deploying them widely.