Skip to content

Playable multiplayer mini minecraft version in discord including world generation, physics and 2D lighting

License

Notifications You must be signed in to change notification settings

JanikCodes/minecraft_discord_py

Repository files navigation

Minimc - 2D Playble Minecraft in Discord


Banner

Important

The bot is running on my server right now, expect it to go down sometimes. Otherwise host it yourself.

Invite the bot here

Minimc is a playable MMO minecraft 'clone' in Discord.
You can generate unique worlds, invite your friends to them and play together.

The game features various logic like handling physics, tick rate, collisions, block states and even really good looking 2D Lighting calculations.
This new version includes image generation which eliminated certain limitations I ran into previously. (Old version used a conversion from data to emojis for rendering the world)

Game View


How to contribute

Create a fork of this repository

Create a Discord Bot. You can do this here.
You'll need it to test your code changes by inviting your bot to your own discord server ( or private chat )

Create a .env file, it should look like your.env but replace the variables with your credentials

Create your database (example: MySQL) with the correct name from .env

You don't have to worry about any tables & data entries because SQLAlchemy is taking care of that process

Depending on your DBMS you maybe have to modify the database.py due to different connectors.

MySQL

 engine = create_engine(f"mysql+mysqlconnector://{user}:{pwd}@{host}/{database}")

MariaDB

 engine = create_engine(f"mysql+pymysql://{user}:{pwd}@{host}/{database}")

Install the required libraries from requirements.txt using pip

pip install -r requirements.txt

🎉 You should now be able to generate a world with the slash command /generate


Documentation

Is there a good way to test world generation quickly?

You can easily test the world generation by executing the file test_render_world_generation.py. It'll automatically generate a brand new world and store a full rendering of that world in a specific output folder.

Can I get a render of all available worlds? (useful in production)

You can easily get a snapshots of all available worlds by executing the file test_render_all_worlds.py.

more coming soon


Feature list

  • 🏃‍♂️ Player movement & rendering
  • 👊 Placing / Destroying blocks
  • 🍎 Physics affecting blocks and entities (sand, gravel, player gravity)
  • ✨ Collision detection
  • 🏠 Structure generation ( Able to create your own presets and spawn them in, see tree.py )
  • 🌎 World generation including ores, caves
  • 🎮 Multiplayer synced movement & states, worlds with invite functionality
  • 💡 2D calculated lighting
  • 🧱 Block states with different rendering depending on the state
  • 🔓 Z-Axis so blocks can be rendered in the background/foreground
  • 🐌 Using Threading for the world generation process

Ideas

  • Redstone
  • AI entities ( chicken, cow, zombie, . . )
  • Dimensions
  • Biomes
  • Health & fall damage
  • PVP
  • Public worlds with server browser ( limited amount of course )
  • Dynamic block states based on more logic ( example: Torch sprite based on adjacent blocks )
  • Block functionality ( TNT that destroys blocks in a radius uppon interacting )
  • Water/Lava simulation

About

Playable multiplayer mini minecraft version in discord including world generation, physics and 2D lighting

Topics

Resources

License

Stars

Watchers

Forks

Languages