<?php
$statut = file_get_contents('https://minecraft-api.com/api/bedrock/status.php?ip={ip}&port={port}');
$json = file_get_contents('https://minecraft-api.com/api/bedrock/status.php?ip={ip}&port={port}&format=json');
echo $statut;
echo $json;
?>
Plain text:
En ligne
JSON:
{"status": "En ligne", "edition": "MCPE", "motd_line1": "Serveur Bedrock", "protocol_version": 686, "version_name": "1.21.0", "players_online": 12, "players_max": 100, ...}
<?php
$motd = file_get_contents('https://minecraft-api.com/api/bedrock/motd.php?ip={ip}&port={port}');
echo $motd;
?>
Plain text:
Serveur Bedrock - Survie
JSON:
{"motd": "Serveur Bedrock - Survie"}
<?php
$online = file_get_contents('https://minecraft-api.com/api/bedrock/playeronline.php?ip={ip}&port={port}');
echo $online;
?>
Plain text:
12
JSON:
{"online": "12"}
<?php
$maxplayers = file_get_contents('https://minecraft-api.com/api/bedrock/maxplayer.php?ip={ip}&port={port}');
echo $maxplayers;
?>
Plain text:
100
JSON:
{"maxplayers": "100"}
<?php
$version = file_get_contents('https://minecraft-api.com/api/bedrock/version.php?ip={ip}&port={port}');
echo $version;
?>
Plain text:
1.21.0
JSON:
{"version": "1.21.0", "protocol": 686}