Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command output hologram #157

Open
3 tasks done
MithrandirCraft opened this issue Oct 8, 2023 · 2 comments
Open
3 tasks done

Command output hologram #157

MithrandirCraft opened this issue Oct 8, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@MithrandirCraft
Copy link

MithrandirCraft commented Oct 8, 2023

Just making sure

  • I have read the wiki and made sure, this feature is not yet in the plugin.
  • I believe, that this feature is possible to implement.
  • I made sure, that this feature has not been requested yet.

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
Copy link
Contributor

Andre601 commented Oct 8, 2023

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
Copy link
Author

MithrandirCraft commented Oct 10, 2023

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):

  • Run the command as the server/console.
  • Read the output: To be honest, I don't know how you'd do this, but I'm sure there is a straightforward solution, you can check HolographicScoreboard which already implemented this functionality for HolographicDisplays.
  • Display on hologram: This would require a (customizable?) refresh time to run the two previous steps and then display on the hologram for refresh purpose, else the hologram may display old output until the server restarts.

(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.

@d0by1 d0by1 added the enhancement New feature or request label Jan 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants