A dynamic web-based world map for PocketMine-MP servers. For a full overview over all functions of the plugin, go to the documentation
/pocketmap
(or /pmap
) command is now available, the previous commands (/render
and /reload
) are now/pmap help
/pmap marker
).Go to the changelogs
Download the newest version of the plugin from Poggit CI
Place the plugin in the plugins folder of your PocketMine-MP server
Restart your server, this will load the plugin data.
config.yml
and change web-server.port
to your new allocated port (replace 3000
).Go to http://<server_ip>:<web-server.port>
to see the map.
3000
, so if you haven't changed it, use this port.If you have already created a world, and it is not yet (completely) visible on PocketMap, do the following:
/pmap render full <world>
When you load new chunks in your world which have not been added to the map, the chunks will automatically be
rendered.
If there are still chunks missing, make a full render of the world by executing /pmap render full <world>
When a player breaks or places blocks, the map will automatically be updated after some time.
If the rendering speed is too slow for you, or your server can't handle it anymore, you can change some values in
the config.yml
to resolve these issues.
config.yml
renderer
scheduler
chunk-scheduler
Please report all issues you encounter here.
This is a list of all things that have to be added before the release of v1.0.0
x z
(vector 2) argument type instead of x y z
(vector 3)/api/<plugin_name>
MarkerManager
class such that plugins are able to make use of the build in markerThis is the documentation of a lot of the PocketMap features.
Some commands also need arguments, the following argument types are provided in this readme:
< ... >
: required{ ... }
: optional for players but required for console, current location of the player is used when not provided[ ... ]
: optional, default values will be usedGet a list of all command.
Usage: /pmap help
Usage: /pmap marker
name
: Name of the marker, required.world
: Name of the world the marker is inid
: Custom identifier for a markerposition
: Position (x y z
)icon
: Name of the icon defined in markers/icons.json
pos1
: First position (x y z
)pos2
: Second position (x y z
)Add markers to you map
/pmap marker add icon <name> <icon> {position} {world} [id]
/pmap marker add circle <name> <radius> {position} {world} [id]
radius
: The radius (in blocks) of the circle, required/pmap marker add area <name> <pos1> {pos2} {world} [id]
pos1
and pos2
as corners/pmap marker add line <name> <pos1> {pos2} {world} [id]
pos1
and pos2
You can remove any marker with the marker remove command.
Usage: /pmap marker remove <id> {world}
id
defined in markers/markers.json
.Reload some parts of the plugin data, this will apply most changes in the running plugin.
Available parts:
config
: Reload the plugin configdata
: Reload the folder structureweb
: Reload the web configUsage: /pmap reload <part>
You can render a specific area of the map by using the render command.
Usage: /pmap render {x} {z} {world} {zoom}
x
: The x coordinate of the regionz
: The z coordinate of the regionworld
: THe world name of the regionzoom
: The zoom level of the region in the interval [0,8], where zoom
is an area of 2zoom * 2Start a full world render for the given world.
Usage: /pmap render full {world}
Lookup the chunk and region coordinates of a given world position.
Usage: /pmap render lookup {x y z} [zoom]
x y z
is the position in the worldzoom
is the amount of zoom regions you want the region coordinates from.
0
zoom
]On the webpage of PocketMap (http://<server_ip>:<pocketmap_port>/
) you can view the real map. On the map you can do
the following:
config.yml
or web/config.json
PocketMap makes use of the vanilla resource pack provided by bedrock-samples. To make PocketMap more consistent with your server, all resource packs you use in your server are also used in PocketMap.
To show the map on the webpage, the minecraft world has to be rendered as images first. This is a complex process, and I'm constantly improving the rendering algorithm to make it faster and more efficient.
When a chunk is being rendered, we loop through all x,z positions in the chunk and get the highest block at each of the
positions.
For each block we get the block type name and the block state. With these values, the correct texture is inside
the resource_packs/terrain_textures.json
is found and used as the texture in the map.
Not all blocks are the same, and PocketMap tries to make all blocks appear like in the minecraft world, such as
y%2 = 1
, will appear a bit darker than blocks with y%2 = 0
There are different types of markers you can use in PocketMap. You can add three different types of markers using
commands, but it is also possible to add markers by hand.
The markers that are visible on the web map are all defined in the file markers/markers.json
. It is also possible to
add markers by hand.
icon
: An icon displayed at a given positioncircle
: A circle with its center at the given position and a given radius in blockspolygon
: An area with the given corners, at least 3 corners need to be provided.polyline
: A line with multiple points, lines will be drawn between one point and the next.You can add some markers using commands. Please go to the marker command documentation for more details.
It is possible for plugins to make use of PocketMaps built-in marker system.
softdepend
list in your plugin.yml
. (Don't use the depend
list, as this requires all userssoftdepend: [
..., # Other plugins
PocketMap
]
use Hebbinkpro\PocketMap\PocketMap;
where you want to use the add markers.if (class_exists(PocketMap::class)) {
$markers = PocketMap::getMarkers();
}
MarkerManager
in theonEnable
function.MarkerManager
in the plugin's onLoad
function.$markers->getIcons(): array
$markers->getMarker(string $id, World $world): ?array
$markers->removeMarker(string $id, World $world): bool
$markers->addIconMarker(string $name, Position $pos, string $icon, ?string $id = null): bool
$markers->addCircleMarker(string $name, Position $pos, int $radius, ?string $id = null, string $color = "red", bool $fill = false, ?string $fillColor = null): bool
$markers->addPolygonMarker(string $name, array $positions, World $world, ?string $id = null, string $color = "red", bool $fill = false, ?string $fillColor = null): bool
$markers->addPolylineMarker(string $name, array $positions, World $world, ?string $id = null, string $color = "red", bool $fill = false, ?string $fillColor = null): bool
markers/markers.json
{
"<id>": {
// replace <id> with the custom identifier for the marker
"name": "string",
// the name of the marker
"data": {
// ... the data fields of the marker
}
}
}
These are all marker data types that are implemented for the front-end using Leaflet's marker system.
These are commonly used fields for the data types given below
{
"x": "int|float",
// the x coordinate in the world
"z": "int |float"
// the z coordinate in the world
}
{
"color": "red",
// the border color
"fill": false,
// if the marker is filled
"fillColor": "red"
// the color of the filled area
}
{
"type": "icon",
// the data type
"icon": string,
// the name of the icon
"pos": position
// position of the marker
}
{
"type": "circle",
// the data type
"options": {
// ... default options
"radius": "int|float"
// the radius (in blocks) of the circle
},
"pos": position
// postion of the marker
}
{
"type": "polygon",
// the data type
"options": options,
// options
"positions": []
// list of all corner positions
}
{
"type": "polyline",
// the data type
"options": options,
// options
"positions": []
// list of all positions of the line
}