GithubHelp home page GithubHelp logo

nathan21hz / mcdaemon Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kafuuchino-desu/mcdaemon

0.0 0.0 0.0 58 KB

a python script for automatically controlling Vanilla Minecraft server

License: GNU General Public License v3.0

Python 100.00%

mcdaemon's Introduction

MCDaemon

中文文档


A software for automatically controlling minceraft server with support for plugins
tested on Centos7 with python2

how to use

1.download the latest release
2.unzip it and create a shell script named as start.sh
3.type your server start commands in the script (i suggest you write like this cd server && java -xxx so you can put your server files in the server folder to organize the files easier) 4.install the requirments using pip install -r requirements.txt 5.you can start the server using python server.py now


Plugin API

OnServerInfo() API

(non blocking)define a function named as onServerInfo(server, info) in your plugin file(for example plugin.py)

onServerStartup() API

(non blocking)define a define a function named as onServerStartup(server) in your plugin file(for example plugin.py)

onPlayerJoin() and onPlayerLeave() API

(non blocking)define a function named as onPlayerJoin(server, playername) or onPlayerLeave(server, playername),the playername variable is a string containing the name of which player is joining/leaving server


API objects

the server object contains those attributes:

server.stop():stops the server

server.start():starts the server

server.send(string):send a string to server's STDIN,remember to add a '\n' to execute the command,use execute() if not necessary

server.execute(command):execute a command

server.say(data):a simple wrapper for the /tellraw @a command

server.tell(player, text):a simple wrapper for the /tellraw command

the info object contains those attributes:

info.hour/info.min/info.sec:time of this line of log

info.sourceProcess:which process sent this message ,such as 'Server Thread/INFO'

info.isPlayer:if the message is sent by a player

info.player:which player sent this message

info.content:if the message is not sent by a player it will contain the message printed after the sourceProcess, if the message is sent by a player it will ONLY conain the message player sent such as hi

but not <chino_desu> hi

reloading plugins:

use!!MCDReload to reload the plugins


About

this repo is currently maintained by chino_desu(minecraft id:chino_desu).

you can contact me by:

twitter: @chino_desu_

discord: chino_desu#8564

mcdaemon's People

Contributors

kafuuchino-desu avatar nathan21hz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.