How yukocha0/computerpc-minecraftbrowsermod works
1. What this mod is
- Computer PC is a Fabric Minecraft mod that turns placed blocks into a multiblock in-world browser display.
- The core architectural idea is: a world-placed block cluster owns browser state, while the client renders that state using an embedded Chromium runtime.
2. Top-level split: server/game logic vs client/browser UI
- src/main/java/justpc/computerpc contains the shared/game-side logic: blocks, block entities, browser state models, networking, and registries.
- src/client/java/justpc/computerpc contains the client-only rendering and screens: browser bootstrap, display rendering, and the remote control UI.
- This split is important because browser initialization/rendering is client-only, while block state and multiplayer sync must exist on both sides.
3. World object model: Display Block + Block Entity
- DisplayBlock is the placeable block players build into a screen wall.
- DisplayBlockEntity is the persistent per-block data holder. It likely stores the display’s browser-related state and participates in save/load and sync.
- The block entity is the main boundary between Minecraft world state and browser runtime state.
4. Multiblock behavior
- The util package contains DisplayCluster and DisplayClusterResolver, which indicate the display is not treated as isolated blocks but as a cluster of connected blocks.
- This cluster layer is the architectural unit for things like shared power state, shared browser session, resolution/aspect handling, and “one screen wall behaves like one display.”
- From an architecture diagram perspective, the cluster resolver is the bridge from individual blocks to a logical display surface.
5. Browser state model
- browser/BrowserTabData and browser/DisplayStateData are the main state carriers.
- BrowserTabData represents tab-level browser information, while DisplayStateData appears to represent the overall screen/display configuration.
- These are the data objects that move across boundaries: saved world state, multiplayer synchronization, and client-side UI/rendering.
6. Client-side embedded browser integration
- BrowserBootstrap and DisplayBrowserManager are the client-side integration points for the embedded browser runtime.
- The README says the mod uses embedded Chromium via JCEF, so these classes likely manage browser process startup, lifecycle, and per-display browser instances.
- BrowserRenderUtil suggests a render bridge that takes browser output and makes it drawable inside Minecraft.
7. Rendering pipeline
- client/render/DisplayBlockEntityRenderer is the in-world renderer for the display block entity.
- The render path is: world/block entity state → browser output handled by browser manager → rendering utility → block entity renderer draws it in the game world.
- This is a key boundary: the game engine renders a browser-backed texture/surface instead of a static block texture.
8. Player-facing control surface
- client/screen/RemoteBrowserScreen and client/screen/DisplayControlScreen are the interactive GUIs.
- RemoteItem on the game side is the item that opens the controller UI, which matches the README’s “Browser Remote.”
- VolumeSlider is a custom widget for per-display audio control, showing that media volume is part of the display state, not just a browser setting.
9. Multiplayer/network synchronization
- network/ComputerpcNetworking and network/ComputerpcPayloads define the packet layer.
- The mod explicitly supports multiplayer synchronization so nearby players see the same browser activity; these payloads are the conduit for updates like URL changes, tab actions, power toggles, and display settings.
- In diagram terms, this is the cross-boundary path between a client action and authoritative display state.
10. Registries and content bootstrap
- registry/ComputerpcBlocks, ComputerpcBlockEntities, and ComputerpcItems centralize Fabric registration.
- Computerpc.java and ComputerpcClient.java are the likely mod entrypoints that wire up registration, networking, rendering, and client bootstrap.
- This registry layer is the startup boundary that connects Minecraft’s mod lifecycle to the rest of the codebase.
11. Assets and data pack content
- src/main/resources holds the block/item models, blockstates, language, recipes, and loot tables.
- These files define the in-game identity and crafting/loot behavior for display and remote, but they do not contain core runtime logic.
- Architecturally, they support the mod’s world objects and items rather than driving behavior.
12. Build/runtime constraints
- The project is built with Gradle and targets Minecraft 26.1 / Fabric / Java 25.
- The embedded browser runtime and client-only classes mean the project has a meaningful runtime dependency boundary: server-safe game logic must stay separate from browser/JCEF-dependent code.
- The README also notes the bundled browser runtime may need initialization on first launch, which affects client startup behavior.
13. How the main data flow works
- Player places display blocks → block entities persist state → cluster resolver groups them into a logical screen → browser manager opens/updates embedded browser instances → renderer draws browser output in the world → networking syncs state changes to other players → remote UI sends control commands back to the authoritative state.
- That loop is the core architecture to capture in a diagram.
14. Useful diagram boundaries
- Separate these boxes: Minecraft world objects, multiblock cluster logic, browser runtime/rendering, player control UI, and network sync.
- The strongest coupling points are between block entities and cluster resolution on one side, and browser manager/rendering plus networking on the other.
Main entry points: ComputerpcNetworking.java Networking · Computerpc.java Computerpc · DisplayBlockEntity.java Display Entity · DisplayBlock.java Display Block
Components 22
Game logic
Shared block, state, networking, and registry code.
- Computerpc · Main Fabric entrypoint for shared initialization.
src/main/java/justpc/computerpc/Computerpc.java - Display Block · Placeable block that forms the visible screen surface.
src/main/java/justpc/computerpc/block/DisplayBlock.java - Display Entity · Persistent world state for each display block.
src/main/java/justpc/computerpc/blockentity/DisplayBlockEntity.java - Cluster Resolver · Detects connected blocks and builds a logical display cluster.
src/main/java/justpc/computerpc/util/DisplayClusterResolver.java - Display Cluster · Logical screen wall representation shared across blocks.
src/main/java/justpc/computerpc/util/DisplayCluster.java - Display State · Top-level display configuration and browser session state.
src/main/java/justpc/computerpc/browser/DisplayStateData.java - Browser Tab · Per-tab browser data used by the display state.
src/main/java/justpc/computerpc/browser/BrowserTabData.java - Networking · Packet registration and multiplayer synchronization path.
src/main/java/justpc/computerpc/network/ComputerpcNetworking.java - Payloads · Concrete network payload definitions for display updates.
src/main/java/justpc/computerpc/network/ComputerpcPayloads.java - Remote Item · Player-held item that opens or controls the browser UI.
src/main/java/justpc/computerpc/item/RemoteItem.java - Blocks · Registers the display block and related block content.
src/main/java/justpc/computerpc/registry/ComputerpcBlocks.java - Block Entities · Registers the display block entity type.
src/main/java/justpc/computerpc/registry/ComputerpcBlockEntities.java - Items · Registers the remote and block item content.
src/main/java/justpc/computerpc/registry/ComputerpcItems.java
Client runtime
Browser integration, rendering, and player-facing screens.
- ComputerpcClient · Client-only entrypoint for browser and render setup.
src/client/java/justpc/computerpc/ComputerpcClient.java - Browser Bootstrap · Initializes the embedded Chromium runtime on the client.
src/client/java/justpc/computerpc/client/BrowserBootstrap.java - Browser Manager · Manages per-display browser instances and lifecycle.
src/client/java/justpc/computerpc/client/DisplayBrowserManager.java - Render Util · Converts browser output into something Minecraft can draw.
src/client/java/justpc/computerpc/client/render/BrowserRenderUtil.java - Block Renderer · Renders the display block entity in the world.
src/client/java/justpc/computerpc/client/render/DisplayBlockEntityRenderer.java - Remote Screen · Browser remote interface for player control.
src/client/java/justpc/computerpc/client/screen/RemoteBrowserScreen.java - Control Screen · Display configuration and control interface.
src/client/java/justpc/computerpc/client/screen/DisplayControlScreen.java - Volume Slider · Custom volume control for display audio.
src/client/java/justpc/computerpc/client/widget/VolumeSlider.java
Assets
Resource and data files that define in-game content.
- Resources · Blockstates, models, language, recipes, and loot tables.
src/main/resources
Connections 25
- Computerpc → Blocks: registers · Shared startup wires up content registration.
- Computerpc → Block Entities: registers · Shared startup wires up block entity types.
- Computerpc → Items: registers · Shared startup wires up items.
- Computerpc → Networking: initializes · Shared startup sets up multiplayer sync.
- Blocks → Display Block: creates · Registry exposes the display block.
- Block Entities → Display Entity: creates · Registry exposes the display block entity.
- Items → Remote Item: creates · Registry exposes the remote item.
- Display Block → Display Entity: owns · Placed blocks carry persistent block entity state.
- Display Entity → Cluster Resolver: resolved by · Block entity participates in multiblock grouping.
- Cluster Resolver → Display Cluster: builds · Connected blocks are collapsed into one logical display.
- Display Cluster → Display State: drives · Cluster shape and state feed the browser session model.
- Display State → Browser Tab: contains · Overall display state includes tab-level browser data.
- ComputerpcClient → Browser Bootstrap: starts · Client entry initializes browser runtime.
- ComputerpcClient → Browser Manager: wires · Client entry prepares browser lifecycle management.
- Browser Bootstrap → Browser Manager: enables · Embedded Chromium startup supports per-display instances.
- Browser Manager → Render Util: feeds · Browser output is handed to rendering utilities.
- Render Util → Block Renderer: draws · Rendered browser surfaces are composited in-world.
- Display Entity → Networking: syncs · World state changes are propagated across players.
- Networking → Payloads: defines · Packet layer is specified by payload types.
- Remote Item → Remote Screen: opens · Item launches the player remote control UI.
- Control Screen → Volume Slider: uses · Control screen includes audio control widget.
- Remote Screen → Networking: sends · UI actions become sync packets.
- Control Screen → Networking: sends · Display settings changes become sync packets.
- Resources → Display Block: describes · Resources define block visuals and identity.
- Resources → Remote Item: describes · Resources define remote visuals and identity.