admin管理员组文章数量:1026989
I am writing my own server for Minecraft PE using libraries Bedrockpy for python, here is the server code:
from bedrock.server import Server
import json
app = Server()
@app.server_event
async def ready(ctx):
print(ctx.host, ctx.port)
@app.game_event
async def mob_killed(ctx):
mob = ctx._data['victim']['type']
text = f"§p[System]: Вы победили §c{mob}\n§aВам начисленно 10 очков опыта"
raw_text = json.dumps({"rawtext": [{"text": text}]})
await ctx.server.run(f'tellraw @s {raw_text}')
@app.game_event
async def player_message(ctx):
print(ctx._data["message"])
if ctx._data["message"] == "!help":
text = "§p=====[HELP]=====\n §a[Command List]\n 1. !help\n 2. !user\n§c=====[WARNING]=====\n§aКоманды должны иметь обязательный префикс '!'"
raw_text = json.dumps({"rawtext": [{"text": text}]})
await ctx.server.run(f"tellraw @s {raw_text}")
app.start("GameDev.aternos.me", 37921)
Everything works fine if you run the server on the local host Everything works fine if I run the server on the local host, but only I can connect to it on command:
/connect 127.0.0.1:37291
Decided to connect this system to an external server: GameDev.aternos.me Need to:
- Make it so that other players can connect to the server written in python.
- If there is a way to deploy the server in the cloud (optional)
I work with the console Termux, because there is no possibility to write code from a PC now... If there is any way to create a Minecraft server pe If there is any way to create a Minecraft Bedrock server using Python, please help...
I am writing my own server for Minecraft PE using libraries Bedrockpy for python, here is the server code:
from bedrock.server import Server
import json
app = Server()
@app.server_event
async def ready(ctx):
print(ctx.host, ctx.port)
@app.game_event
async def mob_killed(ctx):
mob = ctx._data['victim']['type']
text = f"§p[System]: Вы победили §c{mob}\n§aВам начисленно 10 очков опыта"
raw_text = json.dumps({"rawtext": [{"text": text}]})
await ctx.server.run(f'tellraw @s {raw_text}')
@app.game_event
async def player_message(ctx):
print(ctx._data["message"])
if ctx._data["message"] == "!help":
text = "§p=====[HELP]=====\n §a[Command List]\n 1. !help\n 2. !user\n§c=====[WARNING]=====\n§aКоманды должны иметь обязательный префикс '!'"
raw_text = json.dumps({"rawtext": [{"text": text}]})
await ctx.server.run(f"tellraw @s {raw_text}")
app.start("GameDev.aternos.me", 37921)
Everything works fine if you run the server on the local host Everything works fine if I run the server on the local host, but only I can connect to it on command:
/connect 127.0.0.1:37291
Decided to connect this system to an external server: GameDev.aternos.me Need to:
- Make it so that other players can connect to the server written in python.
- If there is a way to deploy the server in the cloud (optional)
I work with the console Termux, because there is no possibility to write code from a PC now... If there is any way to create a Minecraft server pe If there is any way to create a Minecraft Bedrock server using Python, please help...
本文标签: python 3xError createconnect server for minecraft pe with using bedrockpyStack Overflow
版权声明:本文标题:python 3.x - Error create+connect server for minecraft pe with using bedrockpy - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745661910a2161941.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论