Skip to content

Getting started with API

Timaaos edited this page Feb 7, 2021 · 9 revisions

In this tutorial you will make default Craft.py file! Lets start from importing:

import api as mc
import pyglet

Now we need to create object of our window:

window = mc.Window(width=800, height=600, caption='CraftPy', resizable=True)

To change window name, you need to change caption, for example:

caption='MY FIRST MINECRAFT'

Now we need to setup object:

mc.setup()

Now we need to run our app:

pyglet.app.run()

You done! Try your own minecraft!

Full code:

import api as mc
import pyglet
window = mc.Window(width=800, height=600, caption='CraftPy', resizable=True)
mc.setup()
pyglet.app.run()
Clone this wiki locally