Minecraft 5

By Just Sparrow

Just Sparrow

0 subscribers

Based on the following code

Minecraft 4

Minecraft 4

Just Sparrow

15 views · 13h ago

9 views·2h ago·Recreated 1 times

About

This project is a remix of Minecraft 4 — built by clicking "+ Create with this code" and giving Claude (by Anthropic) an additional prompt. The biggest change: you now have first-person movement. Walk around the world with WASD, jump with Space, and build from your own perspective. The camera is controlled by click-and-drag instead of OrbitControls, with a crosshair in the center of the screen. Basic gravity keeps you grounded on top of blocks.

Prompt Used

Based on the previous code, add first-person style movement WITHOUT using PointerLockControls or the Pointer Lock API, because this app runs inside an iframe that does not allow pointer lock. Instead, implement camera controls as follows: click and drag on the canvas to rotate the camera view (track mouse delta while mouse button is held down). WASD keys move the player forward, left, backward, and right relative to the camera's facing direction. Add basic gravity so the player stays on top of blocks. Space key to jump. Show a small crosshair in the center of the screen. Do not use OrbitControls either — implement custom mouse-drag rotation and keyboard movement manually.

How to Use

Movement

  • W — Move forward
  • A — Move left
  • S — Move backward
  • D — Move right
  • Space — Jump

Camera

  • Click + drag on the canvas to look around

Block Selection

  • Click an inventory slot at the bottom of the screen, or press 1 (Grass), 2 (Dirt), 3 (Stone), 4 (Wood)

Building & Breaking

  • Left-click on a block face to place the selected block type
  • Right-click on a block to remove it
  • A crosshair in the center of the screen shows where you're aiming

Note: This project runs inside an iframe, so Pointer Lock is not available. Camera rotation uses click-and-drag instead.

Want to take it further? Click "Recreate" to remix — try adding a day/night cycle, water blocks, or enemies!

More

If you enjoyed this, please hit the like button and subscribe! Your support helps us create more cool stuff on Coddie.

Loading comments...

Other Codes

No other codes yet