An extention of the Minecraft Pi API.
Project description
libextrapi.so
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 thecustom
base because it is from the RaspberryJuice plugin which isn't compatible with MCPI or Reborn.
I want to add more so please give me suggestions.
Known bugs
- Using the particle
iconcrack
withmc.particle
crashes the game, but using an invaild particle name is fine. postToClient
really doesn't like it when you use\x0a
along 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 usedhtop
to kill reborn.
Extras
Particles
Particles are 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 watercrit
flame
lava
smoke
largesmoke
reddust
ironcrack
(crashes the game)snowballpoof
explode
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
getSlot
from 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
getSlot
andgive
.
- 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
Built Distribution
Hashes for MCPI_Addons-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11b72e4a6e46a3bdecab55882e54d54f33d0656a4ddf68ed2c72ecb529fa1668 |
|
MD5 | d60420f275e6210e93409272a07052b2 |
|
BLAKE2b-256 | a2301b7f74dcf45fef47e2a2709df711c71fb8f785092021e27bde1f560e1d25 |