Caution
This library is in early development. We currently only permit private use. Any sort of commertial use is prohibited. This might change with future versions, when a final license is chosen.
A simple minecraft plugin for sending commands to a server.
The plugin was developed with spigot version 1.21.5 download.
We maintain a compatible python frontend library available in english and german.
This project can be build using maven, just run the mvn command in the directory and it will build the target/sk-mincraft-1.0.jar:
mvnFollow the instructions. Basically.:
- Create an arbitrary folder
- Create a new file (
.txtis the simplest) - Put these three lines below in it (make sure to replace the version in the .jar's filename if needed.
- Rename the file to
start.bat(accept window's warning, we want the file to be executable). - Put the downloaded server-jar in the folder, next to the bat
- Create a new folder inside your current folder, name it
plugins - Put the plugin-jar, you built or downloaded in it
- Create a new file (
java -Xms#G -Xmx#G -XX:+UseG1GC -jar spigot-1.21.5.jar nogui
pause
- This is a plugin intended to be used with a spigot server, just put the jar into the plugin folder.
- Then you can connect to the plugin via tcp on port
25595. - Send each command as a message over tcp, the message has to end with a newline.
- Each command is a commandname followed by a number of arguments. For explanation of the argument types see: Arguments
- The symbols around arguments:
<>??!!indicate the type of the argument. Type - A detailed explanation of each command can be found further down Details.
- Throughout the commands there are references to indices of online players, it is important to note that currently the index is completly based on the order the players joined in and will change if the players disconnect and rejoin. Currently there is no way to identify the players unqiuely based on a id.
- You can of course still differantiate the players based on their names
- We use the symbol
𝇉as the seperator between arguments
- Currently the following dimensions are available
world: the normal overworldworld_nether: The Netherworld_the_end: The End
getPlayer𝇉<index:int>gets information about a player. DetailsgetPlayerByName𝇉<name:String>gets information about a player by namesetPlayerPos𝇉<playerindex:int>𝇉<x:int>𝇉<y:int>𝇉<z:int>𝇉<dimension>𝇉?rotation:int?Set the player position DetailssetPlayerStat𝇉<type:string>𝇉<playerIndex:int>𝇉<value:double>Set a player stat DetailsshowTitle𝇉<playerIndex:int𝇉<title:String>𝇉<subtitle:String>𝇉<fadeIn:int>𝇉<stay:int>𝇉<fadeOut:int>Show a Title to players Details
addInv𝇉<playerIndex:int>𝇉<materialId:String>𝇉?name:String?𝇉?slot:int?𝇉!unbreakable!Add an Item to the Inventor DetailsgetInv𝇉<playerIndex:int>Returns the inventory of a player Details
setBlock𝇉<x:int>𝇉<y:int>𝇉<z:int>𝇉<dimension:String>𝇉<blockid:String>Set a block at a location DeailtsgetBlock𝇉<x:int>𝇉<y:int>𝇉<z:int𝇉<dimension:String>gets information about a block Details
postChat𝇉<message:string>posts a message to chat DetailschatCommand𝇉<command:String>Runs chat command in console DetailspollChatDetails
spawnEntity𝇉<x:int>𝇉<y:int>𝇉<z:int>𝇉<dimension:String𝇉<entityid:String>DetailseditEntity𝇉<target:String>𝇉?name:String?𝇉?position:x;y;z;dimension?𝇉?ai:boolean?DetailsgetEntity𝇉<target:String>Details
spawnBossBar𝇉<name>𝇉<text>DetailseditBossBar𝇉<command:string>𝇉<name:string𝇉?text:string?𝇉?color:string?𝇉?value:float?DetailsdeleteBossBar𝇉<name:string>Details
batch ;|;<command:String>;|;<command:String>Runs all commands in a batch, the;|;acts as the seperator. Please make sure there are no spaces around the seperator except before the first one. Details
Positional arguments are always the first arguments in argument list. They are marked as <arg>. They only consist of the value.
Optional arguments are arguments that are strictly necessary but offer additional options.
They always have the form <argument>:<value> where <argument> is the name of the argument defined by the command and <value> is the value.
Optional arguments are marked as ?arg?
Important usage guides for optional arguments are:
- There must not be a space anywhere in this configuration. If the value needs to contain a space please replace it with the sequence
|&s&|, this will be interpreted as a space - They must come after any positional arguments
Flags are arguments that toggle an effect, the send command just needs to containe the name of the flag. They are marked by !flag!.
- They too must come after any positional arguments
- Optional arguments and flags can be in an arbitrary order
- In each example the first line is the command you sent, the second line is a possible return. An empty return indicates that the server send nothing back.
getPlayer𝇉<index:int>gets information about a player
indexthe index of the online Player
<index:int> <name:String> <x:int> <y:int> <z:int> <dimension:String> <rotation:int> <looking_at_block:String> <sneak:boolean> <max_health:double> <health:double> <food_level:double> <saturation: double> <xp_level:int> <xp_progress:double><index>the index of the player<name>the name of the player<x>, <y>, <z><dimension>The tile position of the player (see dimensions)<rotation>The minecraft rotation of the player.<looking_at_block>The block type the player is looking at<sneak>depending of wether or not the player is sneakingtrueorfalse<max_healt>the max health the player can have<health>the current health of the player usually between 0 and 20<food_level>the current food level of the player always between 0 and 20<saturation>The players saturation level<xp_level>The level number of the player<xp_progress>The current progress of the player along the progress bar, will be between 0 and 1
- If the player is not looking at anything the
looking_at_blockwill be AIR - The rotation will be between -180 and 180
getPlayer𝇉0
0𝇉Player1𝇉39𝇉83𝇉72𝇉17𝇉STONE𝇉falsegetPlayerByName𝇉<name:String>gets information about a player by name
namethe name of the player
- If the player does not exist: "error player_not_found"
- If the player exists see GetPlayer
getPlayerByName𝇉Player1
error player_not_foundsetPlayerStat𝇉<type:string>𝇉<playerIndex:int>𝇉<value:double>
typeone ofMAX_HEALTH,HEALTH,FOOD_LEVEL,SATURATION,XP_LEVEL,XP_PROGRESSplayerIndexthe index of the online playervalue: the value the respective stat should be set to
setPlayerStat𝇉MAX_HEALTH𝇉0𝇉10
setPlayerVelocity𝇉<type:String𝇉<playerIndex:int>𝇉<value:double>
typeone ofUP,DOWN,BACK,LOOKINGUPis an impulse straight upDownis an impulse straight downBACKis an impulse away from the players looking directionLOOKINGis an impulse in the direction the player is looking
playerIndexthe index of the online playervaluethe strength of the impulse. The strenght of a normal player jump is 0.5
setPlayerVelocity𝇉UP𝇉0𝇉1
showTitle𝇉<playerIndex:int>𝇉<title:String>𝇉<subtitle:String>𝇉<fadeIn:int>𝇉<stay:int>𝇉<fadeOut:int>
playerIndexIndex of a player, if the index is smaller then 0 the title is shown to all playerstitleThe title to showsubtitleThe subtitle to showfadeInThe time it takes for the title to fade in, in ticksstayThe time it takes for the title to stay, in ticksfadeOutThe time it takes for the title to fade out, in ticks
showTitle𝇉-1𝇉Das ist ein Title𝇉Mit einem subtitle𝇉200𝇉200𝇉200
addInv𝇉<playerIndex:int>𝇉<materialId:String>𝇉?name:String?𝇉?slot:int?𝇉!unbreakable!
<playerIndex>the index of the player<materialId>the material<amount>The amount that should be added?name?the custom name of the stack in the inventory?slot?The slot in which the item should be added!unbreakable!Controls wether or not the item is unbreakable or not
addInv𝇉0𝇉wooden_pickaxe𝇉1𝇉unbreakable𝇉name:Adrians Pickaxe𝇉slot:2
getInv𝇉<playerIndex:int>Returns the inventory of a player
<playerIndex>Index of the player to query
A series of items of the following structure: <index:int>:<materialname:String>;<displayname:String>:<amount:int>, these are separated by spaces. Notably only inventory slots with content will be sent everything else can be assumed to be empty.
getInv𝇉0
0:LILY_OF_THE_VALLEY:1 4:STONE_PRESSURE_PLATE:1 7:SCULK_SHRIEKER:1 11:REDSTONE:13 25:DISPENSER:1 29:TARGET:1setPlayerPos𝇉<playerindex:int>𝇉<x:int𝇉<y:int>𝇉<z:int>𝇉<dimension:String>𝇉?rotation:int?
playerIndexthe index of the online player<x:>, <y>, <z> <dimension>the new position of the player (see dimensions)?rotation?optionaly the direction the player should be looking in
setBlock𝇉<x:int>𝇉<y:int>𝇉<z:int>𝇉<dimension:String>𝇉<blockid:String>Set a block at a location
<x> <y> <z>position of the block<dimension>see dimensions<blockid>the block id as a string i.e. "stone"
setBlock𝇉10𝇉10𝇉10𝇉stone
getBlock𝇉<x:int>𝇉<y:int>𝇉<z:int>𝇉<dimension:String>gets information about a block
<x> <y> <z>:int int intposition of the block<dimension>see dimensions
getBlock𝇉10𝇉10𝇉10
DEEPSLATEpostChat𝇉<message:string>posts a message to chat
<message>is the message which should be posted, everything after thepostChatis interpreted as the message
postChat𝇉Hello World my name is Adrian
chatCommand𝇉<command:String>Runs chat command in console
<command>is the command, everything after thechatCommandis interpreted as the command. It should not contain the /
chatCommand𝇉say Hello from plugin!
pollChat
- A list of blocks of
<playername>:|<year>|<month>|<day>|<hour>|<minute>|<second> :<playerIndex>:<message>seperated by𝇉
pollChat
Player1:2025|12|21|17|49|27:0:This is a message:2025|12|21|17|49|29:1:Message 2spawnEntity𝇉<x:int>𝇉<y:int>𝇉<z:int>𝇉<dimension:String>𝇉<entityid:String>Spawns an entity
<x> <y> <z>position<dimension>see dimensions<entityid>a string with entity id full list can be cound here: Entities
- the uuid with which the entity can be identified
spawnEntity𝇉10𝇉10𝇉10𝇉Zombie`
ff568527-7c0c-4536-aed2-ef77429d61b8editEntity𝇉<target:String>𝇉?name:String?𝇉?position:x;y;z;dimension?𝇉?ai:boolean?Edits a existing entity which was previously spawned by thespawnEntitycommand
targetis the uuid returned byspawnEntitynameif is set the entites custom name is changedpositionif is set the entities position will be set to the given x,y,z coordinates as well as the dimension ,aisets the ai of the entity, if its turned off the entity will not move.
editEntity𝇉ff568527-7c0c-4536-aed2-ef77429d61b8𝇉name:Zomb𝇉position:10;10;200𝇉ai:false
getEntity𝇉<target:String>
<target>needs to be the entity id returned by spawn Entity
-
<target:String>𝇉<name:string>𝇉<x:int>𝇉<y:int>𝇉<z:int>𝇉<dimension:String>𝇉<health:double> -
<dimensions>see dimensions
getEntity𝇉ff568527-7c0c-4536-aed2-ef77429d61b8
ff568527-7c0c-4536-aed2-ef77429d61b8𝇉Zomb𝇉10𝇉10𝇉200𝇉5spawnBossBar𝇉<name>𝇉<text>
<name>: the name which can later be used to change the boss bar<text>: the text which is above the boss bar.(Currenlty a single word)
spawnBossBar𝇉myuniquename𝇉Text
editBossBar𝇉<command:string𝇉<name:string>𝇉?text:string?𝇉?color:string?𝇉?value:float?
<command> Which edit command should be executed, possible values aretext : Edit the text which is display, the ?text? argument needs to be setcolor: Edit the color of the bossBar ?color? argument needs to be setvalue: Edit the value of the bossbar ?value? argument needs to be setstyle: Edit the style of the bossbar ?style? argument need to bet set
editBossBar𝇉text𝇉myuniquename𝇉text:Hello
deleteBossBar𝇉<name:string>deletes the boss bar
<name>the name of the boss bar
deleteBossBar𝇉myuniquename
!!This command is currently not supported!!
batch ;|;<command:String>;|;<command:String>Runs all commands in a batch, the;|;acts as the seperator. Please make sure there are no spaces around the seperator except before the first one.
- The commands to be batched. Each command can be a normal command, spaces do not need to be replaced.
- Make special note of the space before the first
;|;this is important because otherwise thebatchcommand can not be recognized - a seperator at the end is not necessary but does not affect the outcome, the seperator after the
batchcommand is necessary - If you batch multiple commands which receive input the output comes line-by-line in the order of the commands in the batching command
- This example gives the player wooden pickaxe and post the message "Hello World this is a message" to the chat
batch ;|;addInv 0 wooden_pickaxe 1 unbreakable;|;postChat Hello World this is message`