script options: $ init com.mysql.jdbc.Driver $ db url jdbc:mysql://localhost:3306/mc $ db username admin $ db password haslo on load: # create a table update "CREATE TABLE IF NOT EXISTS yourtable(playername varchar(16), uuid varchar(36), joined varchar(100), kills int, deaths int" stop on first join: # add player's info update "INSERT INTO `yourtable` (`playername`, `uuid`, `joined`, `kills`, `deaths`) VALUES ('%player%', '%player's uuid%', '%now%', '0', '0')" stop on death of a player: set death message to "" if attacker is a player: broadcast "&a%attacker% killed &c%player%&7." # # get 'attacker's kills' and 'player's deaths values from table # set {_kills%attacker%::*} to objects in column "kills" from result of query "SELECT * FROM yourtable WHERE uuid = '%attacker's uuid%'" and close set {_deaths%player%::*} to objects in column "deaths" from result of query "SELECT * FROM yourtable WHERE uuid = '%player's uuid%'" and close set {_kills.%attacker%} to "%{_kills%attacker%::*}%" parsed as integer set {_deaths.%player%} to "%{_deaths%player%::*}%" parsed as integer # # update 'attacker's kills' and 'player's deaths' into database # update "UPDATE `yourtable` SET `kills` = '%{_kills.%attacker%} +1%' WHERE `uuid` = '%attacker's uuid%'" update "UPDATE `yourtable` SET `kills` = '%{_deaths.%player%} +1%' WHERE `uuid` = '%player's uuid%'" stop else: broadcast "&c%player% &7died." # get 'player's kills' from databse and update set {_deaths%player%::*} to objects in column "deaths" from result of query "SELECT * FROM yourtable WHERE uuid = '%player's uuid%'" and close set {_deaths.%player%} to "%{_deaths%player%::*}%" parsed as integer update "UPDATE `yourtable` SET `kills` = '%{_deaths.%player%} +1%' WHERE `uuid` = '%player's uuid%'" stop command /statistics [] []: trigger: if arg-1 is set: if arg-1 is online: if arg-2 is not set: set {_kills%arg-1%::*} to objects in column "kills" from result of query "SELECT * FROM stats WHERE uuid = '%arg-1's uuid%'" and close set {_deaths%arg-1%::*} to objects in column "deaths" from result of query "SELECT * FROM stats WHERE uuid = '%arg-1's uuid%'" and close send "----------------------" send "&6%arg-1%&7's statistics" send "&7• &aKills: &f%{_kills%arg-1%::*}%" send "&7• &cDeaths: &f%{_deaths%arg-1%::*}%" send "----------------------" stop else: send "Unknown command." else: send "&cNo player matching &e%arg-1% &cis connected to this server." else: send "&cUsage: /statistics " on placeholderapi placeholder request for the prefix "1": if the identifier is "1": # The placeholder would be 'custom_message' set the result to "%player%"