All Projects β†’ xPaw β†’ Php Minecraft Query

xPaw / Php Minecraft Query

Licence: mit
🐘 PHP library to query Minecraft servers

Labels

Projects that are alternatives of or similar to Php Minecraft Query

Discordsrv
The Minecraft <-> Discord bridge plugin your mother warned you about. https://www.spigotmc.org/resources/discordsrv.18494/
Stars: ✭ 437 (-24.78%)
Mutual labels:  minecraft
Minecraftforge
Modifications to the Minecraft base files to assist in compatibility between mods.
Stars: ✭ 5,127 (+782.44%)
Mutual labels:  minecraft
Mixin
Mixin is a trait/mixin and bytecode weaving framework for Java using ASM
Stars: ✭ 557 (-4.13%)
Mutual labels:  minecraft
Velocity
The modern, next-generation Minecraft server proxy.
Stars: ✭ 446 (-23.24%)
Mutual labels:  minecraft
Tiler
Tiler is a tool to create an image using all kinds of other smaller images (tiles). It is different from other mosaic tools since it can adapt to tiles with multiple shapes and sizes (i.e. not limited to squares).
Stars: ✭ 4,681 (+705.68%)
Mutual labels:  minecraft
Blockbench
Blockbench - A boxy 3D model editor
Stars: ✭ 495 (-14.8%)
Mutual labels:  minecraft
Phosphor Fabric
A Fabric mod designed to dramatically improve the performance of Minecraft's lighting engine while fixing many bugs
Stars: ✭ 435 (-25.13%)
Mutual labels:  minecraft
Pycraft
Minecraft-client networking library in Python
Stars: ✭ 574 (-1.2%)
Mutual labels:  minecraft
Mohist
Minecraft Forge Hybrid server implementing the Paper/Spigot/Bukkit API, formerly known as Thermos/Cauldron/MCPC+
Stars: ✭ 489 (-15.83%)
Mutual labels:  minecraft
Worldguard
πŸ›‘οΈ Protect your Minecraft server and lets players claim areas
Stars: ✭ 553 (-4.82%)
Mutual labels:  minecraft
Yarn
Libre Minecraft mappings, free to use for everyone. No exceptions.
Stars: ✭ 453 (-22.03%)
Mutual labels:  minecraft
Viaversion
Allows the connection of newer clients to older server versions for Minecraft servers.
Stars: ✭ 463 (-20.31%)
Mutual labels:  minecraft
Tuinity
Stars: ✭ 531 (-8.61%)
Mutual labels:  minecraft
Railcraft
The Railcraft Mod for Minecraft, source and development.
Stars: ✭ 446 (-23.24%)
Mutual labels:  minecraft
Open Builder
Open "Minecraft-like" game with multiplayer support and Lua scripting support for the both client and server
Stars: ✭ 569 (-2.07%)
Mutual labels:  minecraft
Protocolsupport
Support 1.16, 1.15, 1.14, 1.13, 1.12, 1.11, 1.10, 1.9, 1.8, 1.7, 1.6, 1.5, 1.4.7 clients on Spigot 1.16.2
Stars: ✭ 439 (-24.44%)
Mutual labels:  minecraft
Langcraft
Compiler from LLVM IR to Minecraft datapacks.
Stars: ✭ 495 (-14.8%)
Mutual labels:  minecraft
Minecase
Minecraft server based on Orleans
Stars: ✭ 581 (+0%)
Mutual labels:  minecraft
Minecraftdeveloperguide
πŸ“Minecraft developer Chinese guideοΌŒζˆ‘ηš„δΈ–η•ŒεΌ€ε‘θ€…δΈ­ζ–‡ζŒ‡ε—
Stars: ✭ 574 (-1.2%)
Mutual labels:  minecraft
Immersiveengineering
Wires, transformers, high voltage! Bzzzzt!
Stars: ✭ 548 (-5.68%)
Mutual labels:  minecraft

PHP Minecraft Query Packagist

This library can be used to query Minecraft servers for some basic information.

⚠️ Please do not create issues when you are unable to retrieve information from a server, unless you can prove that there is a bug within the library.

Differences between Ping and Query

There are two methods of retrieving information about a Minecraft server.

Ping

Ping protocol was added in Minecraft 1.7 and is used to query the server for minimal amount of information (hostname, motd, icon, and a sample of players). This is easier to use and doesn't require extra setup on server side. It uses TCP protocol on the same port as you would connect to your server.

MinecraftPing class contains a method QueryOldPre17 which can be used to query servers on version 1.6 or older.

Query

This method uses GameSpy4 protocol, and requires enabling query listener in your server.properties like this:

enable-query=true
query.port=25565

Query allows to request a full list of servers' plugins and players, however this method is more prone to breaking, so if you don't need all this information, stick to the ping method as it's more reliable.

RCON

It is possible to send console commands to a Minecraft server remotely using the Source RCON protocol. Use PHP Source Query library for your RCON needs.

SRV DNS record

This library automatically tries to resolve SRV records. If you do not wish to do so, pass false as the fourth param in the constructor (after timeout param).

Example

<?php
	require __DIR__ . '/src/MinecraftPing.php';
	require __DIR__ . '/src/MinecraftPingException.php';
	
	use xPaw\MinecraftPing;
	use xPaw\MinecraftPingException;
	
	try
	{
		$Query = new MinecraftPing( 'localhost', 25565 );
		
		print_r( $Query->Query() );
	}
	catch( MinecraftPingException $e )
	{
		echo $e->getMessage();
	}
	finally
	{
		if( $Query )
		{
			$Query->Close();
		}
	}
?>

If you want to get ping info from a server that uses a version older than Minecraft 1.7, then use function QueryOldPre17 instead of Query.


If the server has query enabled (enable-query), then you can use MinecraftQuery to more retrieve information about a server.

<?php
	require __DIR__ . '/src/MinecraftQuery.php';
	require __DIR__ . '/src/MinecraftQueryException.php';
	
	use xPaw\MinecraftQuery;
	use xPaw\MinecraftQueryException;
	
	$Query = new MinecraftQuery( );
	
	try
	{
		$Query->Connect( 'localhost', 25565 );
		
		print_r( $Query->GetInfo( ) );
		print_r( $Query->GetPlayers( ) );
	}
	catch( MinecraftQueryException $e )
	{
		echo $e->getMessage( );
	}
?>

For Bedrock servers (MCPE) use ConnectBedrock function instead of Connect, then GetInfo will work.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].