Giter Club home page Giter Club logo

minecraft_with_python's Introduction

Total alerts Language grade: Python Downloads

Description:

A new way of coding Minecraft. Minecraft is a game that you can play on your computer. It is a popular game for people who are interested in building their own worlds. And since a way to code the game itself has been implemented, I tried it. But it was not simple. So I decided to make a generator for the Minecraft Datapacks, so people can make their own Datapacks easily, even though they still need to know Python until I can make it look like Scratch or something this easy.

Installation:

  • First of all make sure you have one of the latest Python version installed on your computer.
  • Ensure you also have pip installed: try running the command "pip3 -V" in a terminal.
  • If this gets you an error message follow these steps to install it.
  • Once you have Python and pip installed, run the command: "pip3 install mcwpy".

Usage:

Now you should be able to import the library in your new Python programs you can use the project below to help you get started with the library:

import mcwpy
  • Create and compile your own datapack.
  • Once the datapack is generated, paste it in the datapacks folder of your Minecraft world.
  • Type /reload to load the datapack.
  • Have fun playing with your brand new handmade datapack!

Example:

# -*- coding: ascii -*-
from mcwpy import *

workspace1 = Workspace(
    name = 'my_workspace',
    functions = {
        'load': 'tellraw @a {"text":"Datapack loaded!"}',
        'hello_world': 'say Hello World!'
    }
)

my_datapack = Datapack(
    title = 'My Datapack',
    pack_mcmeta = Pack_Meta(
        author = 'Myself',
        description = 'My very own Minecraft datapack',
        minecraft_version = Minecraft_Pack_Version.LATEST
    ),
    workspaces = [workspace1]
)

workspace2 = Workspace(
    functions = {
        'main': 'title @a actionbar {"text":"Hey!"}',
        'test': [
            'say Test',
            'execute as @s at @s run summon pig ~ ~ ~'
        ]
    }
)

my_datapack.append(workspace2)
my_datapack.compile()
function my_workspace:hello_world

Screenshot 2021-10-07 162422

Contributing:

If you want to contribute to this project, you can do so by forking it and sending a pull request, I am opened to any idea and contribution.

Credits:

Thanks to @theskyblockman for the idea of using workspaces. Thanks to @Silvathor for the idea of redesigning the workspaces.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.