Download the PHP package dev-lancer/minecraft-status without Composer

On this page you can find all versions of the php package dev-lancer/minecraft-status. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package minecraft-status

Minecraft Status

MinecraftStatus library allows you to communicate with minecraft servers using the most popular protocols.

Installation

This library can be installed by issuing the following command:

Differences between Ping and Query

Ping

Ping uses the TCP protocol to communicate with the Minecraft server in the java edition and bedrock edition, it uses the port on which the server is running. Ping provides the most necessary information (hostname, motd, favicon, and a sample of players). Thanks to its simplicity, it does not require any configuration on the server side, communication works with servers from version 1.7 and above.

To communicate with a server which has a version lower than 1.7, use the PingPreOld17 class

Query

Query uses GameSpy 4 protocol for communication, so you should start listening in the server properties. Query allows you to request more information about the server, but has more security vulnerabilities.

Usage

Query

Example: Query

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

enable-query=true
query.port=25565

QueryBedrock

Example: Bedrock

Use this class for bedrock edition servers

In QueryBedrock you do not need to set anything in the properties of the server, the port on which the server runs is used to communicate with the server

Ping and PingPreOld17

Example: Ping

If you want to get ping info from a server that uses a version older than Minecraft 1.7, then use class PingPreOld17 instead of Ping.

Methods

List of methods

Query QueryBedrock Ping PingPreOld17
connect() X X X X
isConnected() X X X X
disconnect() X X X X
getPlayers() X X
getCountPlayers() X X X X
getMaxPlayers() X X X X
getInfo() X X X X
getFavicon() X
getDelay() X
setTimeout() X X X X
getTimeout() X X X X
setEncoding() X X X X
getEncoding() X X X X
isResolveSRV() X X X X
getHost() X X X X
getPort() X X X X
getMotd() X X X X
getProtocol() X X X

Use before connecting

Sets the timeout for the connection

Sets the character encoding for the returned values using the getInfo() and getPlayers() methods

Connects to the server. There may be a ConnectionException which means that the connection to the server has failed or a ReceiveStatusException when the connection to the server has succeeded, but the communication has not been successful. When the method is used again, it disconnects from the server and establishes a new connection

Use when you are connected

Disconnects the connection to the server

Using the following methods when not connected to the server will throw a NotConnectedException exception, in case you have successfully connected to the server but the communication does not work then they will return a default value of empty

It returns a full array with the information it was able to obtain.

Returns arrays of users

Returns the number of online players

Returns the number of server slots

Returns the favicon as a string

Returns the connection delay [ms]

Returns a motd of the server

Returns the server protocol number

Use independently of the connection

Returns the server host

Returns a port

Returns the character encoding used to encode the values in the getInfo() and getPlayers() methods.

Returns a timeout.

Returns true when a successful connection to the server is made regardless of whether a ReceiveStatusException exception is thrown.

Returns true when an attempt to resolve the SRV occurs on a connection, regardless of the result.

SRV DNS record

The library allows automatic resolution of SRV records, by default the service is enabled, to disable it you must specify false in the fourth parameter of the constructor

License

MIT


All versions of minecraft-status with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
ext-mbstring Version *
ext-json Version *
ext-iconv Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package dev-lancer/minecraft-status contains the following files

Loading the files please wait ....