Skip to content

Minecraft Binding ​

This binding integrates Minecraft with openHAB through the spigot plugin (sources).

The binding allows reading of server and player data. It furthermore keeps track of redstone power going below signs and links them to Switch items.

Youtube Videos ​

Minecraft Binding 1

Minecraft Binding 2

Discovery ​

The Minecraft binding automatically finds all Minecraft servers running this plugin on the local network. Servers can be added manually if they are not found automatically.

Note

Discovery uses zeroconf, which may not work if you host a Minecraft server in a virtual machine or container.

Channels ​

Depending on the Thing type, different channels are provided:

Server ​

Channel Type IDItem TypeDescription
nameStringName of Minecraft server
onlineSwitchOnline status
bukkitVersionStringThe bukkit version running on server
versionStringThe Minecraft version running on server
playersNumberThe number of players on server
maxPlayersNumberThe maximum number of players on server

Player ​

Channel Type IDItem TypeDescription
playerNameStringThe name of the player
playerOnlineSwitchIs the player connected to the server
playerLevelNumberThe current level of the player
playerTotalExperienceNumberThe total experience of the player
playerExperiencePercentageNumberThe percentage of the experience bar filled for next level
playerHealthNumberThe health of the player
playerWalkSpeedNumberThe speed of the player
playerLocationLocationThe player location
playerGameModeNumberThe player's game mode

Sign ​

Channel Type IDItem TypeDescription
signActiveSwitchDoes the sign have powered redstone below it

Active switch (Controllable from openHAB) ​

Active switch configuration example

Passive sensor ​

Passive sensor configuration example

Example Thing Definition ​

The easiest method to add Minecraft servers, players, and signs is to use automatic discovery. You can also manually define the objects using Thing configuration files. Players and signs are connected through Minecraft server bridges (see documentation).

dsl
Bridge minecraft:server:myminecraftserver "Minecraft server for Friends" @ "Minecraft" [ hostname="192.168.1.100", port=10692 ] {
  Thing player my_name "My Minecraft User" @ "Minecraft" [ playerName="minecraft_username" ]
  Thing player friends_name "My Friend's Minecraft User" @ "Minecraft" [ playerName="friends_username" ]
  Thing sign sign_name "Example Sign" @ "Minecraft" [ signName="sensor" ]
}