コマンドと権限

警告

These docs have not been fully updated to SpongeAPI 8 and may be out of date. If you feel like you can help update them, please submit a PR!

コマンドは、サーバ運営者がサーバを管理することができ、もしくは、プレイヤがサーバと対話できる一つの方法です

In Sponge, commands follow a system of パーミッション. Permissions allow server operators to control who can access what commands. By default, all commands are granted to players with OP status. Players without operator status do not have access to administrative commands or commands that require an assigned permission node. A server operator can fine-tune who can access what commands by adding/negating permission nodes through a permissions plugin.

注釈

Sponge はパーミッション管理プラグインではありません。各プレイヤーまたはグループにおける権限の追加もしくは剥奪のためには、パーミッション管理プラグインを別途探す必要があります。

管理者コマンド

一般のプレイヤーコマンドに加えてこれらのコマンドをサーバー管理者は利用できます。

Sponge

次のコマンドは、Sponge サーバにおいてオペレータステータス(もしくは適切な権限ノード)を持つプレイヤーが利用可能です

コマンド

説明

権限

/sponge audit

Mixin デバッグを有効にするために読み込まれていないクラスのロードを強制します。

sponge.command.audit

/sponge blockinfo

Shows the type and some additional information about the block you are looking at.

sponge.command.blockinfo

/sponge chunks

ワールド、次元、もしくは全体のチャンクデータを出力します。

sponge.command.chunks

/sponge config

ワールド、次元、もしくは全体の設定を変更します。

sponge.command.config

/sponge entityinfo

Shows the type and some additional information about the entity you are looking at.

sponge.command.entityinfo

/sponge heap

JVM ヒープ領域をダンプします。

sponge.command.heap

/sponge metrics

Gets or sets whether metric (also known as server stats) collection is enabled for a given plugin.

sponge.command.metrics

/sponge mods

Lists currently installed forge mods. (SpongeForge only)

sponge.command.mods

/sponge plugins list

Lists currently installed Sponge plugins.

sponge.command.plugins

/sponge plugins refresh

プラグインに自身を再読込するよう要求します。

sponge.command.plugins.refresh

/sponge reload

グローバル、ワールド、ディメンションの設定をリロードします

sponge.command.reload

/sponge save

グローバル、ワールド、ディメンションの設定を保存します

sponge.command.save

/sponge tps

それぞれのワールドにおける1秒あたりの tick 数を表示します。

sponge.command.tps

/sponge version

Sponge/SpongeAPI のバージョンをコンソールに出力します。

sponge.command.version

/sponge which

Prints which plugin provided the command, it’s aliases and alternatives.

sponge.command.which

/sponge:callback

Internally used for callback actions on Components (such as pagination). Not intended to be invoked by hand.

/sponge:help

サーバ上のコマンド使用に関する情報を表示します。

sponge.command.help


Sponge コマンドのパラメータ

  • /sponge chunks [-g] [-d dim] [-w world]

  • /sponge config [-g] [-d dim] [-w world] key value

  • /sponge save [-g] [-d dim|*] [-w world|*]

  • /sponge reload [-g] [-d dim|*] [-w world|*]

Command Conflicts

In cases of command conflict, Sponge provides a primary alias mechanism to specify which command is to be used. For example, Minecraft provides the reload command and Sponge provides the reload command. To specify which command to use, prefix it with minecraft or sponge and a :. So, to use Sponge’s reload command above, type in /sponge:reload. This approach can also be used to handle conflicts between mods and/or plugins. Do the same thing, just use the mod-id or the plugin-id and a :. An example is /examplemodid:tp.

Furthermore, the primary alias mechanism can be used to overcome incompatibilities. Let’s say a plugin registers a command, but the command is incompatible with your mod. If you can configure your mod to use a Minecraft native command or another plugin’s command, you can restore the expected behavior or prevent unexpected behaviors.

注釈

The /sponge audit command forces loading of any classes which have not yet been loaded, allowing the full output from all mixin debugging environment variables to be captured. This also requires the mixins.checks variable, see the Mixin wiki for more information.

ちなみに

Here are a few simple examples of the sponge config command in action. Note that at least one target flag must be specified. Please see Sponge の設定 for a more detailed explanation.

  1. /sponge config -d minecraft:nether logging.chunk-load true

Since a dimension type was specified, this would alter the nether dimension config (and hence all nether worlds).

  1. /sponge config -w DIM1 logging.chunk-load true

This would alter the config of world named DIM1.

Sponge provides two permissions for debugging purposes:

  • Allow using Sponge’s block and entity tracking message channel: sponge.debug.block-tracking This message channel is used by the client (if the SpongeForge mod is installed) to display the block and entity owner and notifier in the debug view.

  • Allow hovering of command execution errors to get the stacktrace: sponge.debug.hover-stacktrace

Forge

The following commands are available only when using the SpongeForge coremod on Forge. Other implementations of the SpongeAPI, such as SpongeVanilla, do not include these commands.

コマンド

説明

権限

/forge tps

それぞれのワールドにおける1秒あたりの tick 数を表示します。

forge.command.forge

/forge track

タイルエンティティの追跡を有効にします。

forge.command.forge


vanilla のコマンド API を利用する Forge MOD のコマンド権限は常に <modid>.command.<commandname> の形式になっています。

vanilla

There are several commands built-in to vanilla Minecraft that are also available on servers powered by Sponge. The list below is not comprehensive, but it includes the most commonly used commands. These commands are available to players with operator status (or the correct permission node). In general, permissions for vanilla Minecraft commands on a Sponge server are of the structure minecraft.command.<command>, as shown below.

コマンド

説明

権限

/ban

プレイヤーを BAN します。

minecraft.command.ban

/ban-ip

プレイヤーの IP アドレスを BAN します

minecraft.command.ban-ip

/banlist

BAN された全プレイヤーを表示します

minecraft.command.banlist

/clear

インベントリを全消去します

minecraft.command.clear

/deop

プレイヤーから op 権限を剥奪します。

minecraft.command.deop

/difficulty

ゲームの難易度を設定します。

minecraft.command.difficulty

/gamemode

プレーヤのゲームモードを設定します。

minecraft.command.gamemode

/gamerule

ゲームルールを設定します。

minecraft.command.gamerule

/give

プレイヤーにアイテムを与えます。

minecraft.command.give

/kill

プレイヤーかエンティティをキルします。

minecraft.command.kill

/op

プレイヤーに op 権限を与えます。

minecraft.command.op

/pardon

BAN リストからプレイヤーを削除します。

minecraft.command.pardon

/save-all

サーバをセーブします。

minecraft.command.save-all

/save-off

サーバの自動保存を無効にします。

minecraft.command.save-off

/save-on

サーバの自動保存を有効にします

minecraft.command.save-on

/setidletimeout

プレーヤが kick されるまでにどれぐらい停止しているかを定義します

minecraft.command.setidletimeout

/setworldspawn

ワールドのスポーン位置を設定します

minecraft.command.setworldspawn

/stop

サーバを停止します。

minecraft.command.stop

/toggledownfall

天候の晴れと雨を切り替えます

minecraft.command.toggledownfall

/tp

プレーヤやエンティティをテレポートします

minecraft.command.tp

/weather

決められた状態の天候に設定します

minecraft.command.weather

/whitelist

ホワイトリストの管理をします。

minecraft.command.whitelist

/worldborder

ワールド範囲の管理をします

minecraft.command.worldborder


Sponge also creates permissions for these Minecraft features:

  • Allow player to use the entity-selector in commands: minecraft.selector

  • Allow player to bypass spawn-protection in all worlds: minecraft.spawn-protection.override

  • Allow player to bypass force-gamemode in all worlds: minecraft.force-gamemode.override

  • Allow editing an ordinary commandblock of the given name: minecraft.commandblock.edit.block.<name>

  • Allow editing a minecart commandblock of the given name: minecraft.commandblock.edit.minecart.<name>

注釈

These permissions use the actual name of the commandblock, which is normally @ by default.

There are also extra permissions managing the access to the server:

  • Treat the user as whitelisted: minecraft.login.bypass-whitelist

  • Allow this user to bypass the server’s player limit: minecraft.login.bypass-player-limit

注釈

Sponge offers improved multi-world support, such as per-world world borders. By default, Sponge only changes the world border (or other world options) of the world the player is currently in. The vanilla behavior of setting it for all worlds can be restored using the global configuration and setting sponge.commands.multi-world-patches.worldborder (or the corresponding entry) to false. See global.conf for details. Sponge assumes that multi-world plugins also provide optimized configuration commands for those options and thus does not provide its own variants.

プレーヤコマンド

次のコマンドは、オペレータステータスの無いプレーヤにとって、バニラの Minecraft の一部として利用可能です

コマンド

説明

権限

/help

View information on commands used on the server, by default the Sponge command will be used instead!

minecraft.command.help

/me

あなたが何をしているのか全員に伝えます

minecraft.command.me

/say

全員(もしくは、選択者を使用した場合、特定のプレーヤ)にメッセージを表示します

minecraft.command.say

/tell

他のプレーヤにプライベートメッセージを送ります

minecraft.command.tell


A full list of vanilla commands can be found at: https://minecraft.wiki/w/Commands#List_and_summary_of_commands. Permissions for vanilla Minecraft commands on a Sponge server are of the structure minecraft.command.<command>.

Command Features

Sponge and most Sponge plugins support additional command features such as auto completion and hoverable text. The image below shows the output using the /sponge plugins command (yellow box). The elements in that list can be hovered over to get addition information such as the current version number (red box). Some elements in the example below also have additional actions bound to them. For example, the plugin entries in that list can be clicked to show more detailed information (purple box) about that plugin. This is equivalent to sending the /sponge plugins <pluginId> command. The auto completion can be triggered by pressing tab. Entering /sponge plugins  (with a trailing space) and then pressing tab will show a list of possible values (turquoise box) that can be used in that context. Pressing tab again will iterate the possibilities, if any. Theoretically it is possible to write most commands by pressing only tab and space (and maybe the first letter of each segment).

command features

ちなみに

If you are a plugin author and you want to use hoverable text and text actions in your plugin, then head over to our Text documentation.