Minecraft Blogs / Tutorial

Minecraft Skript Plugin Full Tutorial

  • 392 views, 2 today
  • 2
  • 1
PixelCraft__YT's Avatar PixelCraft__YT
Level 47 : Master Imposter
43
Hello!
Today I am going to take you through the world of skripting.
I'm going to start already so you don't have to waste your time reading my boring introduction.

1. Download Skript
In order to actually start skripting, you have to download the plugin. It's at bukkit.org and you can search it there. Just download it, put the plugin onto your server, restart it or reload bukkit, and there, step 1 is officially done.

2. Creating a Skript
To create a skript, you have to go to your file manager in your server dashboard and go to the Plugins folder. Then, you need to click on the Skript folder. You will see a series of files, click the folder that is called "Scripts." You need to create a file (not a folder). You can call it whatever you want, you just have to add a .sk at the end or it won't take the file as a skript and remove it from the folder.
3. Skripting
It seems you're ready to start coding! There are lot's of things you can do. Skripting includes indents. Press tab on your computer/laptop to indent one line. Here is an example of indenting lines:
-----------------------------------------------
command /spawn:
  trigger: 
    execute console command "tp %player% 585 371 -448"
--------------------------------------------------------------------------------------------------------------------------
Any time you add a colon in a line, you need to indent the next line.
4. a Simple Spawn Skript
If you were to create a spawn skript, it would be very easy. But if you were to add a /spawn thing when you die, first join, and type /spawn, that might be a challenge. After doing a "command /(command):", before you execute a command you must add a "trigger:". To execute a command, you can do "execute console command "(command)". Don't add any slashes(/) to it though. Also, when using a custom command or a command when somebody joins, instead of typing @s or @p to teleport the player executing the /spawn command somewhere, you need to use %player% so it can find out the player's username. If it was on death, though, you would have to use %victim% for the one dying and %attacker% for the one that killed the player. (%attacker% could be mobs other than players, so you could use "if attacker is a player:".) Example:


---------------------------------------------------------------------------------------------------------------------------------

command /spawn:

  trigger:
    execute console command "tp %player% 565 293 -484"
on death:
  execute console command "tp %victim% 565 293 -484"
  send "You killed %victim%!" to attacker
on first join:
  execute console command "tp %player% 565 293 -484"
---------------------------------------------------------------------------------------------------------------
If using on death spawn tp, you should type "
/gamerule DoImmediateRespawn true" in-game if opped.
5. Creating a Variable
To create a variable, it's actually much easier than it sounds and it let's you do a lot of other things. First, you have to create it, by using the code "set {_variable1} to true"
You can set the _(name) to whatever you want, you just must add the brackets and the underscore at the start. You can use "while {_variable1} is true:" to execute a command WHILE the variable is true, or you can do "if {_variable1} is true:" which only executes it once. Example:


--------------------------------------------------------------------------------------

command /tphimtome:

  trigger:
    set {_tp} to true


    while {_tp} is true:
      execute console command "tp captainnemo1019 PixelCraft_I_D_K"
------------------------------------------------------------------------------------------------------------------------------------------------------
6. Free Tutorials
In the Scripts folder, there are different files that have dashes(-) at the start of them. That means they're disabled. Those are all skripts created that players can use as a template. By removing the dash and renaming the file, you can use the skript.
7. Saving Skripts
If you're done with you're skript(s), instead of restarting your server and saving the files, you can save the file, go in-game, and type "/skript reload all". It will lag a lot when ran, but not so much to lag your server. When executing this command, errors may show. Those are skript errors. If those show, you need to fix the error it tells you.




Thank you for checking out this tutorial! Cya y'all!
Tags

Create an account or sign in to comment.

Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome