gilesknap / mciwb Goto Github PK
View Code? Open in Web Editor NEWMinecraft Interactive world builder
License: Apache License 2.0
Minecraft Interactive world builder
License: Apache License 2.0
Provide a function to save the current paste selection to file (TODO need a better name for paste selection)
Also provide a load from file to indicated position.
One-line docstring should fit on one line with quotes (found 3) (D200)
"""
I would prefer trap most exceptions - e.g.
doing an expand before select gets an error but its non fatal.
Need to make it clear that you want the java edition now that Minecraft for Windows is in the same launcher.
Missing docstring in public package (D104)
from ._version_git import __version__
It appears mciwb is not compatible with rcon 2.1.1. But this is the version of rcon that is installed with python 3.9. I am unable to install the latest version of rcon. Which means, I can't install mciwb. Any help would be greatly appreciated.
ERROR: Could not find a version that satisfies the requirement rcon>=2.3.6 (from mcwb>=0.2.1->mciwb) (from versions: 1.0.0, 1.0.1, 1.0.2, 1.0.4, 1.0.5, 1.0.6, 1.0.7, 1.0.8, 1.0.9, 1.0.12, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.1.6, 1.1.7, 1.1.8, 1.1.9, 1.2.0, 1.2.1, 1.2.2, 1.2.3, 1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.3.6, 1.3.7, 1.3.8, 2.0.0, 2.0.1, 2.0.2, 2.0.8, 2.0.9, 2.1.0, 2.1.1)
ERROR: No matching distribution found for rcon>=2.3.6 (from mcwb>=0.2.1->mciwb)
1 blank line required between summary line and description (found 0) (D205)
Hello @gilesknap
I am following along with the Backup and Restore instructions and I have a question. For the part after (.venv), are we using the username info before the @ sign? I tried a variety of ways, but I keep getting a syntax error.
useradd@DESKTOP-KSM4GML:~/my_world$ (.venv) [useradd@ws1 mciwb]$ ls $HOME/mciwb-backups
bash: syntax error near unexpected token `[useradd@ws1'
useradd@DESKTOP-KSM4GML:~/my_world$ (.venv) [ahUn1t$@ws1 mciwb]$ mciwb restore my-first-backup
bash: syntax error near unexpected token `[ahUn1t$@ws1'
useradd@DESKTOP-KSM4GML:~/my_world$ (.venv) [useradd@DESKTOP-KSM4GML mciwb]$ ls $HOME/mciwb-bqckups
bash: syntax error near unexpected token `[useradd@DESKTOP-KSM4GML'
can this command be used to make sign monitoring more efficient?
If so monitor a wider range for signs ...
Hello. I'm trying to learn python with Minecraft using MCIWB.
For context, I'm using Docker, VSCode, Python 3.10.6, and iPython 8.11.0
When I typed in world.player.pos, I get the following error:
Unhandled exception in event loop:
File "/usr/lib/python3.10/asyncio/events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "/home/useradd/my_world/.venv/lib/python3.10/site-packages/prompt_toolkit/input/vt100.py", line 173, in callback_wrapper
callback()
File "/home/useradd/my_world/.venv/lib/python3.10/site-packages/prompt_toolkit/application/application.py", line 698, in read_from_input
self.key_processor.process_keys()
File "/home/useradd/my_world/.venv/lib/python3.10/site-packages/prompt_toolkit/key_binding/key_processor.py", line 272, in process_keys
self._process_coroutine.send(key_press)
File "/home/useradd/my_world/.venv/lib/python3.10/site-packages/prompt_toolkit/key_binding/key_processor.py", line 187, in _process
self._call_handler(matches[-1], key_sequence=buffer[:])
File "/home/useradd/my_world/.venv/lib/python3.10/site-packages/prompt_toolkit/key_binding/key_processor.py", line 322, in _call_handler
handler.call(event)
File "/home/useradd/my_world/.venv/lib/python3.10/site-packages/prompt_toolkit/key_binding/key_bindings.py", line 126, in call
result = self.handler(event)
File "/home/useradd/my_world/.venv/lib/python3.10/site-packages/IPython/terminal/shortcuts/init.py", line 374, in handle_return_or_newline_or_execute
return newline_or_execute_outer(shell)(event)
File "/home/useradd/my_world/.venv/lib/python3.10/site-packages/IPython/terminal/shortcuts/init.py", line 397, in newline_or_execute
status, indent = shell.check_complete(check_text)
Exception 'NoneType' object has no attribute 'check_complete'
Press ENTER to continue...
Unhandled exception in event loop:
File "/usr/lib/python3.10/asyncio/events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "/home/useradd/my_world/.venv/lib/python3.10/site-packages/prompt_toolkit/application/application.py", line 698, in read_from_input
self.key_processor.process_keys()
File "/home/useradd/my_world/.venv/lib/python3.10/site-packages/prompt_toolkit/key_binding/key_processor.py", line 272, in process_keys
self._process_coroutine.send(key_press)
File "/home/useradd/my_world/.venv/lib/python3.10/site-packages/prompt_toolkit/key_binding/key_processor.py", line 187, in _process
self._call_handler(matches[-1], key_sequence=buffer[:])
File "/home/useradd/my_world/.venv/lib/python3.10/site-packages/prompt_toolkit/key_binding/key_processor.py", line 322, in _call_handler
handler.call(event)
File "/home/useradd/my_world/.venv/lib/python3.10/site-packages/prompt_toolkit/key_binding/key_bindings.py", line 126, in call
result = self.handler(event)
File "/home/useradd/my_world/.venv/lib/python3.10/site-packages/IPython/terminal/shortcuts/init.py", line 374, in handle_return_or_newline_or_execute
return newline_or_execute_outer(shell)(event)
File "/home/useradd/my_world/.venv/lib/python3.10/site-packages/IPython/terminal/shortcuts/init.py", line 397, in newline_or_execute
status, indent = shell.check_complete(check_text)
Exception 'NoneType' object has no attribute 'check_complete'
Press ENTER to continue...
I've tried researching the problem, but have had no luck in terms of finding a solution. Is there a way to resolve this?
Hello @gilesknap
I'm doing the nether portal build in the loops section. I'm receiving an error that says minecraft:obsidian is not in list. The code works fine when I copy and paste it from the instructions into the terminal, but when I type it in myself, I get the error as shown
In [1]: pos = world.player.pos
In [2]: for x in range(4):
...: # bottom row
...: world.set_block(pos + Direction.EAST * x, Item.OBSIDIAN)
...: # top row
...: world.set_block(pos + Direction.EAST * x, + Direction.UP * 4, Item.OBSIDIAN)
...: for y in range(4):
...: # left side
...: world.set_block(pos + Direction.UP * y, Item.OBSIDIAN)
...: # right side
...: world.set_block(pos + Direction.UP * y + Direction.EAST * 3, Item.OBSIDIAN)
...:
ERROR: ValueError: <Item.OBSIDIAN: 'minecraft:obsidian'> is not in list
Does this all have to be typed into one line in order for it to work?
@jhutar reports that this fails with ERROR: AttributeError: 'NoneType' object has no attribute 'pos').
When the player leaves we need to gracefully terminate her Signs polling thread
Hello. We created this to "draw" image from file in Minecraft as a wall:
Would you be interested in a chapter to the doc describing that code?
import PIL.Image
im = PIL.Image.open("cat.png")
im = im.resize((20, 20))
def decide_black_or_white(x):
if x > 50:
return 255
else:
return 0
im = im.convert('L').point(decide_black_or_white, mode='1')
pixel_map = im.load()
pos = world.player.pos
def draw_pixel(position, x):
world = get_world()
if x == 255:
material = Item.BLACK_CONCRETE
else:
material = Item.WHITE_CONCRETE
world.set_block(position, material)
for row in range(20):
for column in range(20):
draw_pixel(pos + Direction.UP * (20 - 1) + Direction.DOWN * row + Direction.SOUTH * column, pixel_map[column, row])
That code needs a bit of work, but something like this worked for us. IIRC the screenshot is from different image, it was 100 x 100.
The action signs don’t have the action written on the sign - so when placing one it pops up a screen where you can then type in “select” for example. The function does work but in the demo video it seems the action command is already written on the sign so placing it is much quicker because it doesn’t require typing each time… Bug 🐞 or feature? 😄
TODO: implement an undo buffer. This is kind of important as python commands can really trash a world if you get them wrong.
My idea is this. Before any update to the world, clone the effected region into a safe haven at some distant point in the map.
Maybe keep Iwb as the root class for setting things up and then have properties which are objects for various groups of functions.
e.g. we already have self.copier.
I do want to wrap up the common Client and mcwb commands so that we can provide a simpler interface. Just need to decide on the grouping.
One-line docstring should fit on one line with quotes (found 3) (D200)
Hello. First of all, thank you for this great tool! It is a lot of fun playing with it myself and with my kids :-)
I have a problem building doors. Imagine this code:
pos = world.player.pos
world.set_block(pos, Item.STONE)
world.set_block(pos + Direction.UP, Item.STONE)
world.set_block(pos + Direction.WEST * 2, Item.STONE)
world.set_block(pos + Direction.WEST * 2 + Direction.UP, Item.STONE)
world.set_block(pos + Direction.WEST, Item.ACACIA_DOOR)
But the result looks like this:
We have tried multiple ways, but were unsuccessful. Is it possible to build complete doors?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.