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;