Minecraft – bukkit plugin to run small scripts when players (re)spawn

minecraft-bukkitminecraft-java-edition

I'd like to setup my bukkit server to run a small script (like, giving players basic items) when players respawn or enter a world for the first time (or cause every 10th respawn to be in another place). Is there a plugin to do this with bukkit?

Best Answer

Yes, it is possible to run a script on certain events like respawning or first join.

You will need two plugins to do be able to do this: Autorun and CommandHelper. This will assume you have both fully installed.

For this example, I want two commands to run when a player logs on.

  1. Decide what commands you want to use

  2. Create a new alias/macro in Commandhelpers config.txt with the following syntax:

    /macro_name = /command_1 \/command_2
    
  3. Do a server reload

  4. In game, create a Autorun identifier for your macro:

    /addacommand identifier_name macro_name
    
  5. Now bind the identifier to run when a player joins:

    /setjoincommand identifier_name
    
  6. Done.

This is a very simplified way of doing something like this, and both plugins are capable of much more. For instance Autorun can run commands when a player walks over a defined block; and Command helper can be used as an advanced scripting plugin.

Always make sure to read the instructions for both plugins before you start. However, you probably only need to read the beginners section of Commandhelper, as the rest covers very advanced scripting information.

Hope this answers your question.