Ajneb97 / ServerVariables

MIT License
5 stars 5 forks source link

[Feature Request] More Objects #23

Open ElFrod0 opened 1 month ago

ElFrod0 commented 1 month ago

Hello, currently thinking of migrating my own variable system to this plugin. But I am missing one feature, which would be a total game changer. For now we can only apply variables to 2 different "objects" - Server & Player.

Server variables are global, player ones are linked to chosen player. This will be enough for most users, but to let this plugin achieve it's fullest potential it would be great to add more "objects", which could be linked to players, blocks, or nothing at all...

Right now we can theoretically just use the server type variables to achieve basically anything. But it would be very tedious, if we had to set 4 variables for.. let's say specific block and we had 300 of those blocks. That's 1200 variables we would have to configure. That's what custom objects would make a lot easier.

First we would have to specify the object name, for example: Furnace, which would link to a certain block in world (could be done with ConditionalEvents's BLOCK_PLACE event.). To make things consistent... every object creation would be saved in ServerVariables/objects/<objectName>/<world>-<posX>-<posY>-<posZ>.yml file or possibly in MySQL. And after that, we would have specified the variable structure for our Furnace object, let's say it would be:

variables:
  slot1Material:
    variable_type: OBJECT
    value_type: TEXT
    initial_value: "empty"
  slot1Count:
    variable_type: OBJECT
    value_type: INT
    initial_value: 0
#...more variables...

And now with proper configuration in ConditionalEvents we will create a new object for every placed Furnace block. Interacting with it would open Custom GUI filled with data from our object's variables.

This feature will definitely add a lot of possibilites (if added obviously). Feel free to ask about the implementation, but I believe you already understand what this would achieve.

Cheers, Michal