API - Join Actions

While you can make your own Join Actions, DiscordBridge provides some of its own Join Actions that you can use. This page contains a list of all those Join Actions, as well as their functions and how to use them.

ActionSpawn
ActionSpawn (import com.PintTheDragon.DiscordBridge.JoinAction.ActionSpawn;) is a simple Join Action that will send a player to spawn. Using this Join Action is simple, just use the following code below:
API.addAction(authorUUID, new ActionSpawn());
That's it! Now, the player will be sent to spawn immediately if they are online, or when they next join if they are not.

ActionCommand
ActionCommand (import com.PintTheDragon.DiscordBridge.JoinAction.ActionCommand;) is a Join Action that will force a player to run a command. This Join Action does make use of the data parameter, which will be set to the command you want to run (remove the "/" at the beginning). This command can also contain placeholders, which will be listed below, as well as placeholders from PlaceholderAPI. Here is a list of the placeholders you can use (THESE ARE CASE-SENSITIVE):
  • ${username} - The player's username.
  • ${uuid} - The player's UUID.
  • ${posX} - The player's X-Position
  • ${posY} - The player's Y-Position
  • ${posZ} - The player's Z-Position
  • ${world} - The name of the world the player is currently in
Here is an example of how to use this command:
API.addAction(authorUUID, new ActionCommand(), "me I am at ${posX}, ${posY}, ${posZ} in world ${world}!");
After that, the player will say where they are in chat if they are online, or will say it once they join the server.

ActionConsoleCommand
ActionConsoleCommand (import com.PintTheDragon.DiscordBridge.JoinAction.ActionConsoleCommand;) is very similar to ActionCommand, the only difference being that the command is run from console instead of by the player. Here's how to use it:
API.addAction(authorUUID, new ActionConsoleCommand(), "say ${username} am at ${posX}, ${posY}, ${posZ} in world ${world}!");
After that, the console will say where the player is at in chat if they are online, or will say it once they join the server.
ActionChat
ActionChat (import com.PintTheDragon.DiscordBridge.JoinAction.ActionChat;) is again, very similar to the previous two Join Actions, the only difference being that the player will say something into chat instead of running a command. Here's how to use it:
API.addAction(authorUUID, new ActionChat(), "I am at ${posX}, ${posY}, ${posZ} in world ${world}!");
After that, the console will say where the player is at in chat if they are online, or will say it once they join the server.
ActionTeleport
ActionTeleport (import com.PintTheDragon.DiscordBridge.JoinAction.ActionTeleport;) will teleport the player to specified coordinates as well as an optional world. The data parameter for this Join Action will either look like "x y z" or "x y z worldName", depending on if you want to specify a world. You can use it like:
API.addAction(authorUUID, new ActionTeleport(), "1000 1000 1000 world");
After that, the player will be teleported to x: 1000, y: 1000, z:1000 at world "world" if they are online, or they will be teleported once they join.

That's all for the available Join Actions. If you have any suggestions for some Join Actions, let me know and I'll do my best to add them!