An extention of the Minecraft Pi API.
Project description
MCPI Addons
A Minecraft Pi Edition: Reborn mod to add more features to the api.
Installing
First you will need to install from pip, to do that you can use pip3 install mcpi-addons
If you don't want to compile it (or can't) then you can grab the newest version from the releases page.
Compiling
Just run make && make install to create and install the bianary.
What does it do?
It adds these:
custom.getUsername(mc.getUsername()) to get the players username.custom.postWithoutPrefix(mc.postWithoutPrefix(msg)) to post directly to chat (avoids usernames and sanitation).custom.postClient(mc.postToClient(msg)) to post chat messages client side. It bypasses sanitization.custom.getSlot(mc.getSlot()) to get the contents of the current slot.custom.give(mc.give(id, auxiliary = -2, count = -2)) to change the current slot (-2 means it will stay the same, it isn't -1 becuase the id of -1 exists).custom.press(mc.press(key)) to simulate pressing and holding a key (for examplemc.press("W")ormc.press("SPACE")).custom.unpress(mc.unpress(key)) to releases a key.custom.worldName(mc.worldName()) to get the name of the world.custom.worldDir(mc.worldDir()) to get the directory of the world.custom.particle(mc.particle(x, y, z, particle)) to spawn a particle at a location. x, y, and z are floats and automaticly have 0.5 added to them so that they are centered.custom.debug(mc.debug(msg)) prints a message to debug (only shown ifMCPI_DEBUG= 1)custom.info(mc.info(msg)) prints a info message.custom.warn(mc.warn(msg)) prints a warning.custom.err(mc.err(msg)) prints a error and stops MCPI.custom.getUsernames(mc.getUsernames()) to get a list of the usernames that are playingworld.getPlayerId(mc.getPlayerEntityId(name)) this gets the entity id of a player from their name. This doesn't use thecustombase because it is from the RaspberryJuice plugin which isn't compatible with MCPI or Reborn.custom.overrideTile(mc.overrideTile(before, after)) overrides the tile with the id ofbeforeto the tile with the id ofafterunlessafteris an invaid id.custom.overrideItem(mc.overrideItem(before, after)) overrides the item with the id ofbeforeto the item with the id ofafterunlessafteris an invaid id. (little testing, will have bugs).custom.resetOverrides(mc.resetOverrides()) resets item and tile overrides.
I want to add more so please give me suggestions.
Known bugs
- Using the particle
iconcrackwithmc.particlecrashes the game, but using an invaild particle name is fine. postToClientreally doesn't like it when you use\x0aalong with some other chars. When posted they might also post a lot of garbage to server side chat. Once it wouldn't stop spamming chat until I usedhtopto kill reborn.
Extras
Particles
Particles are client side and only shown if the player is within 16 blocks.
Here is a particle list I found at 0x107511 in minecraft-pi
bubble(only works in water)critflamelavasmokelargesmokereddustironcrack(crashes the game)snowballpoofexplode
Advanced features
Most people won't need to call this directly, but mc.getOffset(worldDir) can get the X and Z offset from level.dat (make sure to use mc.worldDir and not mc.worldName with it).
The basepath is controlled by mc.basepath and defaults to "~/.minecraft-pi/games/com.mojang/minecraftWorlds/".
Changelog
-
1.0.1
- Added functionality to
world.getPlayerId. - Added
custom.getUsernames.
- Added functionality to
-
1.0.0
- Stopped
getSlotfrom crashing the game with invaild ids. - Added
press,unpress,worldName,worldDir,particle,getOffset, and logging (debug,info,warn,err). - Uploaded to pypi and github.
- Stopped
-
Beta
- Added
getSlotandgive.
- Added
-
Alpha
- Had
getUsername,postWithoutPrefix, andpostClient.
- Had
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file MCPI-Addons-1.0.2.linux-x86_64.tar.gz.
File metadata
- Download URL: MCPI-Addons-1.0.2.linux-x86_64.tar.gz
- Upload date:
- Size: 25.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.11.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2287b9b91c8e7b5bcff4a831428e3e206be644b8cec3a1273df7b244f6ea3549
|
|
| MD5 |
e50ef5ef1617bdb33340307c4737241e
|
|
| BLAKE2b-256 |
a90b4844165ab9b7bcb04c8facf9f3e5e6c1ab30e381bb85fe9260949d6bcf41
|