Server-wide Global Variables/Registries #11223
Replies: 2 comments 1 reply
-
I don't think that this is really in scope for the project, and would be a whole bunch of effort which is already required for catching up with what the game actually supports. custom items are not a real thing, though, Mojang is slowly heading in that direction. |
Beta Was this translation helpful? Give feedback.
-
They're slowly heading in that direction and a lot of progress has been made overtime. Items, wolves, banners, music discs, armor trims, and probably more that I'm forgetting can have custom models applied to them. More and more across the community, people are wanting add custom functionality to these things on servers so they don't have to deal with helping players download client mods. I feel like this is something that will be extremely useful for server developers, but I do get the out-of-scope argument. |
Beta Was this translation helpful? Give feedback.
-
Is your feature request related to a problem?
I've been working on building some modular plugin systems and realized that there is no easy way to make custom items that other plugins do not interact with.
EG: a custom model wolf with custom behavior plugin fights with another plugin that changes base wolf behavior
Describe the solution you'd like.
I wanted to see what you guys thought about adding a global variable or registry system to the server framework. I believe it would allow for greater flexibility, modularity, and compatibility between various plugins, specifically with custom items.
It could be either open wild west where any plugin can register a global variable or some sort of registry system with lists that can be inserted into. If a registry is made for things like custom items, it could be made that unless specifically stated events do not override non-standard vanilla items.
I believe this would be extremely helpful in supporting a new wave of modding where clients only need to have default Minecraft while the server can be modded to the extreme on the backend, as Mojang is slowly adding more and more support for custom models across the game.
Here's an example of what I'm thinking as a practical use:
Let's say I'm building a custom item plugin that uses custom modelled fishing rods as a base object. I have another plugin that disallows fishing rod usage for players who don't have the proper perms (I have a leveling system where players need to upgrade their player level in order to progress to the point of being able to use fishing rods).
Separately, these plugins would both work fine. However, when placed together, suddenly the lower level players can't use the custom modeled items right click functionality as the event is cancelled. The common solution is just to make them compatible with each other using a soft-dependency. But what happens if my friend builds another plugin that also uses fishing rod's right click functionality? His plugin is broken and we have to spend extra time building more functionality into one of our plugins.
Alternatively, if you have some sort of global variable system that allows you to register custom items with custom functionality, we can have the disallow fishing rods plugin check the list on the server quickly without needing to setup a soft dependency with each new plugin we stack in that uses custom modelled fishing rods.
Describe alternatives you've considered.
Databases, API's, and shared config files could be used as alternatives, but they don't seem like the best solution.
Other
Just curious what everyone thinks
Beta Was this translation helpful? Give feedback.
All reactions