4

I would like to know if it is possible to have my auto message plugin display current world border size. It will shrink from a diameter of 20000 to 213 at a rate of 34 meters per hour. So occasionally players should get a message like: Warning! The world border is shrinking! Worldborder is currently 18354 meters from spawn. And the number would be in the next message eg. 18320 and gradually getting smaller.

Does anyone know if this even possible? I don't know if auto message plugin can deliver other placeholders than its own.

I am using an automessage by ELCHILEN096 dev.bukkit.org/projects/automessage If you know any better up to date plugin like this one, or that supports papi and can put any placeholder in the message, if happy to hear one.

EDIT: I have come to a partial solution on this issue. My current solution is to have automessage tell a message that runs a command "/worldborder get" by the player when clicked the text. also added a permission minecraft.command.worldborder.get to let them run the command.

I am still looking for a placeholder type of result without the player having to click the text to get the information.

8
  • There are several AutoMessage plugins out there. Can yours make use of commands? Or if you don't know, please post a link to your plugin.
    – dly
    Commented Jun 7, 2019 at 17:00
  • Mine uses JSON as a language and player can interact with it. Like, run a command after clicking the text.
    – Roopekoo
    Commented Jun 7, 2019 at 20:25
  • 1
    I'm not too familiar with that one and can't test it right now, but you could probably make a clickable Text and run /execute @s worldborder get or if you really need a custom message you'll probably need a scoreboard value.
    – dly
    Commented Jun 7, 2019 at 20:42
  • Does it need to be the plugin that does it? You can just use /execute store result score #border border run worldborder get in Vanilla (after creating the "border" scoreboard) and then display that using e.g. /tellraw, /title or whatever. Commented Jun 7, 2019 at 22:07
  • @dly I have made this somewhat working thanks to user dly for the command suggestion. Now there is a text warning about shrinking worldborder. When it is clicked player runs unknowingly a command "/worldborder get" and with a permission minecraft.command.worldborder.get they can run the command.
    – Roopekoo
    Commented Jun 7, 2019 at 23:09

2 Answers 2

4

It would be much simpler to just use a system of commands to periodically query the current world border size and print that as a message in the chat.

In this example, we will use the score $msg.wb_size main as a score where we store the world border's size. You can choose any scoreboard location you like.

The first step is to query the current world border size and store that to a score. This is done with /execute store … run worldborder get like so:

execute store result score $msg.wb_size main run worldborder get

We can then print this score like so:

tellraw @a {"score":{"name":"$msg.wb_size","objective":"main"}}

Feel free to customize the message with more text before or after the score.

If you want to instead display the diameter of the worldborder square (centre to midpoint of edge), you can divide the retrieved size by 2 before printing it. This requires an additional scoreboard value to be set to the value 2, in this case it is 2 const:

scoreboard players operation $msg.wb_size main /= 2 const
-3

Using the scoreboard command is a popular way to do this, however you will need to create a data pack or command block creation in order to store to and read from it, as well as the plugin won't be able to access these values, unless you directly modify it yourself.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.