From a26d801f4e34b19ed2246174e07bae5666ed4a72 Mon Sep 17 00:00:00 2001 From: Paula Date: Sun, 22 Nov 2026 14:11:37 -0300 Subject: [PATCH] Middling clicking to give in creative --- client/client.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/client.ts b/client/client.ts index 48d721b..50a4813 100644 --- a/client/client.ts +++ b/client/client.ts @@ -352,6 +352,12 @@ export class Client { return; } + // middle click in creative gives the block under the crosshair, like minecraft's pick block + if (hit && this.player.creative && InputManager.is_mouse_pressed(1)) { + const block = EverythingRegistry.get_by_id("blocks", hit.block); + if (block) this.connection.send({ type: "chat", text: `/give ${block.id}` }); + } + // a click uses right away, holding it on blocks keeps using every USE_REPEAT_MS. not while it's using an item const now = performance.now(); const use_pressed = InputManager.is_mouse_pressed(2) && !this.player.using_item;