game.tsRound.ts
19const Commands = ShowScore.toLayer(Effect.gen(function* () {
20const { server } = yield* Paper;
21return ({ player, score }) =>
22Effect.sync(() => {
23server.getPlayer(toJava("java.util.UUID", player))?.sendActionBar(Component.text(`Score: ${score}`, NamedTextColor.GOLDAQUA));
24});
25}));
26
27export default Game.make(Game.mount(RoundGame, {}).pipe(Effect.provide(Commands)));
Terminal
mk dev .
my-game game: installed 618 KB in 41 ms (…/plugins/Minekube/games/my-game.js)
Watching …/my-game/src and …/@minekube/games/src and …/@minekube/runtime/src. Save a file to reload.
my-game game: installed 618 KB in 38 ms (…/plugins/Minekube/games/my-game.js)