Closed esticle closed 1 year ago
Actually that's a great question...but unfortunately they haven't implemented rcon in the bedrock edition so including the cli wouldn't help.
Over here https://github.com/itzg/docker-minecraft-bedrock-server/issues/8#issuecomment-528544941 I show a work around where you can docker attach
to the bedrock container and issue commands.
I guessed that was the case with rcon-cli thanks @itzg
Appreciate the pointer - just a quick one for yourself (or Nitrosito really) - what would the docker-compose equivalent look like? Not having much luck with:
...snip...
ports:
- 19132:19132/udp
restart: unless-stopped
command: run --rm -i -e EULA=TRUE
Then,
# docker attach minecraft-bedrock
[2019-11-11 22:07:22 INFO] Server started.
/help
^P/help
help
^Ztime="2019-11-11T22:07:32Z" level=debug msg="Forwarding signal" signal=stopped
Here is a compose file that allows for using docker attach
where it's the last two lines that are relevant:
version: '3.3'
services:
bedrock:
image: itzg/minecraft-bedrock-server
environment:
EULA: "TRUE"
ports:
- 19132:19132/udp
stdin_open: true
tty: true
BTW, the command
field is tempting, but it's typically for specifying the command arguments to run within the container.
@itzg That works perfectly, nice trick indeed, quite correct in my assumption about the command field - noted.
Tab-completion would be nice if it worked but this is way better than nothing at all, thanks!
There was a ticket logged in September 2018 on Mojang's bug-tracker Jira about the lack of RCON in BDS, but it was invalidated as it was a feature request, not a bug.
Feature requests should go to the suggestions subreddit.
I have made such a request here.
Off the back of the Reddit request, it has now been added to the feature parity list on the official wiki.
Check this out!
Awesome @macchie ! I can add that to the community solutions section if you're interested.
Awesome @macchie ! I can add that to the community solutions section if you're interested.
Of course! :) I'll make sure to make it better and more useful!
Added: https://github.com/itzg/docker-minecraft-bedrock-server/#community-solutions
Thank you very much! I'm currently working on server commands feedback on Telgram and the HTTP API to execute commands.
how download?
Hello, I found a way to send commands to the server, when it was not started with the -it
flags.
The docker image used is very simple so it lacks a few basic linux commands, lis ps
.
Anyway, this is what you have to do:
docker exec -it <bedrock id> /bin/bash
echo "<your command>" > /proc/10/fd/0
That is it.
The process that has the console running is /data/bedrock_server-1.19.11.01
, you can find the correct id with
find /proc -mindepth 2 -maxdepth 2 -name exe -exec ls -lh {} \; 2>/dev/null
Since we have the same image, I would guess we get the same PID for that process: 10
so you can just send commands like
echo "gamerule showcoordinates true" > /proc/10/fd/0
echo "op myuser_please" > /proc/10/fd/0
And you can be a little more clear? For the little ones in this topic. And how to do it on windows?
Actually you can use the docker api to send commands into the Minecraft server. I believe it’s the best practice when you want to control your server by telegram
@mattholy can you clarify that? The previous suggestion made sense to me adapt into a script that can be exec'ed in the container.
@mattholy can you clarify that? The previous suggestion made sense to me adapt into a script that can be exec'ed in the container.
please read this https://docs.docker.com/engine/api/v1.41/#tag/Container/operation/ContainerAttach if still a question, fell free to ask me
Now I understand. Doesn't need to be an API call though
https://github.com/itzg/docker-minecraft-bedrock-server#executing-server-commands
The suggestion from @Bass-03 has now been bundled into the image as send-command
and documentation has been updated:
https://github.com/itzg/docker-minecraft-bedrock-server#executing-server-commands
Noob question - Is it possible to have rcon-cli in the container like on the java edition?