Skip to main content

Spinel

A minecraft server wrapper written in python.

This program in its current state only allows you to read the chat and send commands (as the server).

Tutorial

First, install spinel by running pip install spinel in the terminal.

Import Spinel by using import spinel at the top of your file. You'll need a server premade (which can be done with Pyrite). Rename your server .jar file to spinel_server.jar

Now, make an instance of your server with: server = spinel.server(path).

Start the server with server.start().

To read messages and send commands, make a while loop like so:

while True:
    msg = server.latest_message()

    if msg:
        print(msg.raw) # this prints the whole message
        print(msg.author) # this prints the name of the one who sent the message
        print(msg.content) # this prints the message content

        server.write("say Hello, World") # Writes "Hello, World" to the chat repeatedly

Example

import spinel

server = spinel.server()
server.start()

while True:
    msg = server.latest_message()

    if msg:
        print(msg.raw)
        if msg.content.split(" ")[0] == "!math":
            result = eval(msg.content.split(" ")[1])
            output = 'tellraw @a {"text":"' + msg.content.split(" ")[1] + '=' + str(result) + '"}'
            server.write(output)

This code prints all messages to the python terminal and allows the user to perform basic math using the !math command.

Note

If you print just msg, then it will print msg.raw instead. It is reccomended you use msg.raw anyway to be more explicit. You'll need to manually close your server terminal before relaunching

Dependencies

  • os
  • subprocess
  • sys
  • threading
  • queue

Credits

  • Ravbug
  • Princess
  • Winter_Snake
  • vdvman1
  • AjaxGB
  • A2
  • PeerHeer

Metadata

Release files for spinel 1.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spinel 1.1.5
File Size Uploaded Provenance
spinel-1.1.5.tar.gz 3.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for spinel 1.1.5
File Interpreter ABI Platform
spinel-1.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 7.2 kB

Release files / spinel-1.1.5.tar.gz

Download URL spinel-1.1.5.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a8c4bc8f795264f4c1038c298ea9e2a55338bc402017f6798283557aa5be568f
BLAKE2b-256 checksum
How to use checksums
7d8578c786273ac60da7a5bca507e27b304e0e2ce6f0cb823476812a2dfd4918
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.1

Release files / spinel-1.1.5-py3-none-any.whl

Download URL spinel-1.1.5-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
17c23eade869e13a719050389ca8f8c88b87b6a40b989e661c701e8e61eaad17
BLAKE2b-256 checksum
How to use checksums
f08a92f8f30be553e651ddfad2ba39da51ff99eb19101e697c61e10719bb8898
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.1

Security for spinel 1.1.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page