ゲーム

Minecraft (Paper)

Minecraft (Paper) を valkyr に接続する方法: ブリッジをインストールして設定し、対応するイベントとアクションを確認します。

方式
Paper plugin (Java)
状態
未テストのサンプル
イベント
frame shot ability spawn

Status: untested example, not compiled. Only a Java 8 runtime was available where it was written (no javac, no Gradle), so the plugin has not been built or run.

Scope

A server side Paper plugin for the operator's own server. It reads only events the server already processes and sends them to a valkyr-server the operator runs. Nothing runs on players' machines. Server operators must follow the game's rules for server operators.

What it sends

Paper eventvalkyr event
PlayerMoveEventframe (position, look, on ground, jump from PlayerJumpEvent)
EntityDamageByEntityEvent by a player or a player's projectileshot with target when the victim is a player (weapon id from the config)
PlayerJoinEvent, PlayerRespawnEvent, PlayerTeleportEventspawn (resets movement history)
BlockBreakEvent (optional, off by default)ability with a configured id, for break rate checks through a cooldown

Events are queued on the main thread as small JSON strings and sent in batches by an async task with java.net.http.HttpClient to POST /v1/matches/{match_id}/events. Actions are polled from GET /v1/actions on an async task and applied on the main thread: actions in kick-on-actions kick the player, actions in notify-on-actions are announced to players with valkyr.notify. The match is ended on plugin disable.

Player ids: valkyr uses unsigned 64 bit ids, so the plugin folds the UUID (most ^ least significant bits) into one. Minecraft does not give plugins the client clock, so client_time_ms equals the server time.

Units and axes

Minecraft is already meters (blocks) and Y up. Yaw 0 faces +Z (south) and grows clockwise toward -X (west); valkyr yaw 0 faces +Z and 90 faces +X, so valkyr yaw = -Minecraft yaw (wrapped). Minecraft pitch is positive looking down, so valkyr pitch = -Minecraft pitch. Positions are the feet position, unchanged.

Configure valkyr-server movement limits for Minecraft speeds (sprinting is about 5.6 m/s, sprint jumping about 7 m/s; elytra, riptide and speed effects go far beyond that, so either raise the limits or skip frames while gliding by extending onMove).

Build and install

Requirements: JDK 21 and Gradle 8 (or add a Gradle wrapper).

ShellShell
cd integrations/minecraft-papergradle build

Copy build/libs/valkyr-paper-0.1.0.jar to the server's plugins/ folder, start the server once, then edit plugins/ValkyrBridge/config.yml (set api-key to a valkyr-server key with the ingest role) and restart.

ゲーム名とプラットフォーム名は各所有者に帰属し、互換性の説明のためにのみ使用しています。valkyr はそれらと提携していません。

GitHub でこのページを編集