Skip to content

Commit 30748ec

Browse files
authored
feat(paper/admin): commands (#652)
* feat: document the /paper command * feat: document remaining commands * chore: some style
1 parent a1de2e0 commit 30748ec

File tree

5 files changed

+219
-0
lines changed

5 files changed

+219
-0
lines changed

astro.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ export default defineConfig({
149149
],
150150
},
151151
"paper/reference/paper-plugins",
152+
"paper/reference/commands",
152153
"paper/reference/system-properties",
153154
"paper/reference/permissions",
154155
],
13.9 KB
Loading
18.8 KB
Loading
26.2 KB
Loading
Lines changed: 218 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,218 @@
1+
---
2+
title: Commands
3+
slug: paper/reference/commands
4+
description: Documentation about all commands added by Paper.
5+
version: 1.21.8
6+
---
7+
8+
This page explains all commands which are added by Paper.
9+
10+
## Bukkit commands
11+
12+
These commands are located under the `bukkit:` namespace.
13+
14+
### version (aliases: ver, about)
15+
16+
The version command displays the version information about the server, the output may look like this:
17+
18+
![](./assets/version-command-output.png)
19+
20+
You can also use this command to display version information about specific plugins.
21+
22+
![](./assets/plugin-version-command-output.png)
23+
24+
### plugins (alias: pl)
25+
26+
The plugins command displays the list of all loaded plugins. Paper differentiates between two types of
27+
plugins: **Paper plugins** and **Bukkit plugins**. The difference is generally only relevant to plugin
28+
developers ([guide to paper-plugin.yml](/paper/dev/getting-started/paper-plugins)). Plugins are marked
29+
as **green** if no issues occurred whilst enabling them and their functionality can be assumed working.
30+
Plugins marked **red** failed to load or were disabled. Check the startup logs for more information if
31+
that happens.
32+
33+
Bukkit plugins furthermore have the possibility of being loaded **with legacy support** enabled. These
34+
are marked with a **yellow star** in front of their name. That usually means the plugin was made for a
35+
very old version of the game or the plugin author simply forgot to specify a target Minecraft version
36+
for their plugin.
37+
38+
You can click on the plugins' names to display version information about that plugin. The click action
39+
is equivalent to running `/version <plugin_name>`.
40+
41+
![](./assets/plugins-command-output.png)
42+
43+
### help (alias: ?)
44+
45+
The help command displays descriptions for all registered commands. It acts
46+
as a quick reference to both built-in commands and any plugin-added commands.
47+
48+
### reload (alias: spigot reload)
49+
50+
:::danger[Deprecation]
51+
52+
The reload command is deprecated for removal. You should instead restart your server
53+
if you wish to update your plugins, as the reload is known for causing issues with plugins.
54+
55+
If you are looking to reload the Paper configs, you can use [/paper reload](#reload).
56+
57+
:::
58+
59+
## Performance profiling
60+
61+
The `/mspt` and `/tps` commands, whilst working fine, are superseded by the `/spark` command,
62+
and you should therefore switch to the `/spark` command instead.
63+
64+
### spark
65+
66+
The only command you should rely on for performance information is the `/spark` command.
67+
The spark subcommands are documented [in the dedicated spark wiki](https://spark.lucko.me/docs/Command-Usage).
68+
69+
### tps
70+
71+
The tps command is a simple command to get the TPS (ticks per second, how often the game loop
72+
is run per second. The higher, the better. Target TPS is 20.0) from the past 1, 5, and 15 minutes.
73+
74+
### mspt
75+
76+
The mspt command is another simple command to get the average, min, and max MSPT (milliseconds per tick, how much time
77+
a tick takes. The lower, the better. MSPT should be below 50 for 20 TPS) of the server from the last 5, 10, and 60 seconds.
78+
79+
### timings
80+
81+
:::danger[Deprecation]
82+
83+
The timings command is deprecated for removal. You should instead use the [spark command](#spark) as a replacement.
84+
85+
More information can be viewed here: https://github.com/PaperMC/Paper/discussions/10565.
86+
87+
:::
88+
89+
## restart
90+
91+
The `/restart` command is part of Spigot's restart mechanism, which makes the server restart when it crashes
92+
or the command is run manually.
93+
94+
:::note
95+
96+
For help setting up the restart script, see
97+
[this gist by Prof_Bloodstone](https://gist.github.com/Prof-Bloodstone/6367eb4016eaf9d1646a88772cdbbac5).
98+
99+
:::
100+
101+
## paper
102+
This section is dedicated to the subcommands of the in-game `/paper` command.
103+
104+
### chunkinfo
105+
The `/paper chunkinfo [<worldname>]` command is used for displaying information about loaded chunks in a world.
106+
You can specify the world to get info about with the `[<worldname>]` argument. If you set it to `*` or leave it
107+
out, it will list information for all worlds.
108+
109+
The output differentiates between multiple types of loaded chunks. Here is a quick rundown of each type.
110+
A more complete documentation may be found in the [Minecraft wiki](https://minecraft.wiki/w/Chunk).
111+
112+
- `Total` As the name suggests, this number describes **all chunks** currently loaded.
113+
- `Inactive` More commonly referred to as "inaccessible", are chunks which are not ticked, but where chunk generation occurs.
114+
- `Full` Usually called **border chunks**. No ticking is happening, but entities and blocks are loaded and accessible.
115+
- `Block Ticking` All game aspects work as expected, except that entities are not spawned naturally or ticked, but still accessible. Also called **lazy chunks**.
116+
- `Entity Ticking` The chunk is being ticked fully.
117+
118+
### debug
119+
The `/paper debug <chunks>` command is used to dump information about all currently loaded chunks to a file. The content
120+
of this file is generally irrelevant for most server admins and is intended to be used by developers.
121+
122+
### dumpitem
123+
The `/paper dumpitem [all]` command can be used to retrieve the data component representation of your currently held
124+
item. Simply running `/paper dumpitem` will yield the item data, which you can use to represent this item in
125+
commands which expect an item argument. `/paper dumpitem all` yields the **full data component representation**,
126+
including default data components you do not have to explicitly declare.
127+
128+
### dumplisteners
129+
The `/paper dumplisteners toFile|<className>` command is primarily intended for developers trying to figure out why
130+
their event handlers might not be working as expected. Using `/paper dumplisteners toFile` will write all
131+
currently registered event handlers to a file, whilst `/paper dumplisteners <className>` will print the registered
132+
event handlers only for the specific event.
133+
134+
### dumpplugins
135+
The `/paper dumpplugins` command is intended for developers trying to figure out issues with their dependencies or
136+
loading order in relation to other plugins. It can also be used to debug bootstrapper providers, general load order,
137+
and listing class loaders for the plugins.
138+
139+
### entity
140+
The `/paper entity list [<filter>] [<world>]` command can be used to list all currently ticking entities.
141+
142+
The `[<filter>]` argument is used to filter the listed entities types and acts similar to a **regular expression**:
143+
- You can use `*` to list **all** entities, which is the default value for this argument.
144+
- You can list individual entities by providing `minecraft:<entity_type>` as the argument. The namespace here is very important.
145+
- To list multiple entities, you can use the `*` as a greedy wildcard expression. For example, to list all entities,
146+
whose names start with **e**, you could use `minecraft:e*`.
147+
- You can also use the `?` single-character wildcard expression. For example, to list `pig` and `piglin`, but **not**
148+
`piglin_brute`, you can provide `minecraft:pig???` as the filter.
149+
150+
The `[<world>]` argument declares the world you want to check the entities in. This defaults to the current world
151+
of a player or to the overworld for the console.
152+
153+
The output will look similar to this:
154+
155+
```
156+
Total Ticking: -78, Total Non-Ticking: 92
157+
10 (3) : minecraft:pig
158+
1 (0) : minecraft:piglin
159+
* First number is ticking entities, second number is non-ticking entities
160+
```
161+
162+
The comment at the end already clearly describes the purpose of the numbers.
163+
164+
### fixlight
165+
The `/paper fixlight` command is a simple command to trigger a full re-calculation of the light map of all currently
166+
loaded chunks. This can be used to fix any lighting issues which commonly occur with plugins like WorldEdit.
167+
168+
### heap
169+
The `/paper heap` is a developer debug command to dump the current JVM heap to a `.hprof` file, which can be analyzed
170+
to detect to amount of memory used by certain objects. The output file can be rather big, so having a bit of free
171+
space on your disk is recommended before running this command (as a general rule, the file is usually smaller
172+
than the currently used memory. You can check the memory consumption using the `/spark healthreport` command).
173+
174+
### holderinfo
175+
The `/paper holderinfo [<world>]` command is used to gather the number of different chunks currently held in memory.
176+
177+
The `[<world>]` argument can be used to define the world to get the chunk holder information for. Leave blank to
178+
default to `*`, which prints the information for all chunks.
179+
180+
In general, the types have the following meanings:
181+
- `Total` The total amount of in-memory chunk holders.
182+
- `Unloadable` The number of chunks that are safe to be unloaded.
183+
- `Null` Chunks, which have received the unload signal, but whose scheduling locks are still held.
184+
- `ReadOnly` The number of chunk holders, which are readable, but not writable to.
185+
- `Proto` A "prototype" chunk, which is a fully working chunk loaded in memory, but which is not currently placed in the world.
186+
- `Full` Represents the number of chunks currently placed in the world.
187+
188+
### mobcaps
189+
Not to be confused with the [playermobcaps](#playermobcaps) subcommand, the `/paper mobcaps [<world>]` command displays
190+
the **global** mob caps for all players in a world. The `[<world>]` argument defaults to the overworld and
191+
can be set to retrieve the mob caps for other worlds as well. The command also lists the number of
192+
chunks in which mobs can spawn.
193+
194+
### playermobcaps
195+
The `/paper playermobcaps [<player>]` command is used to list the local mob caps for a specific player. The `[<player>]`
196+
argument defaults to the player, who ran the command, if one exists.
197+
198+
### reload
199+
The `/paper reload` command is an unsupported command which allows for runtime Paper-config reloading. If you get any issues
200+
after using this command, please make sure to reproduce this on a freshly-started server before asking for help or
201+
reporting it. Do not that this command **does not** reload non-Paper configs, like the `spigot.yml`.
202+
203+
### syncloadinfo
204+
The `/paper syncloadinfo [clear]` command requires the `-Dpaper.debug-sync-loads=true` JVM flag to be explicitly set
205+
before running the command. The command was historically used for debugging purposes during Paper development, but
206+
the mechanism behind the command is currently unused, meaning that the written file will **always** look
207+
like this:
208+
209+
```json
210+
{
211+
"worlds": []
212+
}
213+
```
214+
215+
Outside of checking for whether the command is allowed to be run, the JVM flag is otherwise unused.
216+
217+
### version
218+
The `/paper version` command is an alias to the standard `/version` command.

0 commit comments

Comments
 (0)