entcnt command:

This commit is contained in:
GameHerobrine 2023-01-09 13:31:51 +03:00
parent 233fa5a85e
commit c961de59ba

View file

@ -17,6 +17,7 @@ class EntityAPI{
$this->server->api->console->register("summon", "<mob>", [$this, "commandHandler"]);
$this->server->api->console->register("spawnmob", "<mob>", [$this, "commandHandler"]);
$this->server->api->console->register("despawn", "", [$this, "CommandHandler"]);
$this->server->api->console->register("entcnt", "", [$this, "CommandHandler"]);
}
@ -35,6 +36,8 @@ class EntityAPI{
];
$output = "";
switch($cmd){
case "entcnt":
return "Total amount of entities: ". count($this->entities);
case "summon":
case "spawnmob":
if(!($issuer instanceof Player)){