DecentSoftware-eu / DecentHolograms

A lightweight but powerful hologram plugin with many features and configuration options.
https://www.spigotmc.org/resources/96927/
GNU General Public License v3.0
211 stars 101 forks source link

Command output hologram #157

Open MithrandirCraft opened 1 year ago

MithrandirCraft commented 1 year ago

Just making sure

Problem

No response

Feature

You currently can do a lot of things in DecentHolograms like add minecraft items and heads to the hologram, and make your holograms interactable (haven't really tried this, but I believe it's posible right?) holograms with pages, fancy animations...

But something which would be really useful is the ability to display what would be shown by a command's output, into a hologram. (console output at least)

In essence: When you run a command in console, there is an output. This command could be a leaderboard query or any other kind of useful information to be displayed. What I'm suggesting is for such outputs to be assignable/displayable to holograms.

A TON of servers do this, which is logic, since there are tons of minigames servers out there which want to show who's winning.

This would allow for leaderboards and other kinds of chat based outputs to be displayable through holograms.

I've noticed quite a few admins have been asking for this on discord.

Alternatives

Placeholders were suggested for this, however, they'd require either the original plugins to provide them through PAPI, or an intermediary plugin to be made for this purpose, when decentholograms could just run the hologram configured command, read the console output and paste it into a hologram refresh.

You could use an entirely dedicated separate holograms plugin designed specifically for displaying command outputs, I'm sure there is some out there, just for this, but let's be real here, that's a bit overkill, when u'r already using decentholograms.

Conclusions: There are alternatives, but no DH addons for this. I find this feature belongs in DH.

Andre601 commented 1 year ago

I feel like this would be a really tedious thing to do here, as it would require to execute a command (risky depending on the command in question) and then get the output of it... If the command then also has outputs per-player would this be spammy too.

MithrandirCraft commented 1 year ago

really tedious

It's up to you to evaluate this of course, but I find that technically it should be based on 3 steps (asuming console designed commands only):

(risky depending on the command in question)

bukkit's getServer.dispatchCommand() doesn't have any risk warnings.

As for running dubious commands through such method, commands do have the (rare) potential to be very destructive, but it's up to good server administration to avoid that, I think this is common sense, so idk what you mean with "risky" exactly.

outputs per-player

Depends on the command right? As I said, it's up to the server admin to carefully choose an appropiate command for their hologram, that isn't designed for player output and just prints console text if run from console.