friendlyhj / ZenUtils

https://www.curseforge.com/minecraft/mc-mods/zenutil
MIT License
19 stars 8 forks source link

[Feature/Tool] Expanded ITeam (whos idea was it to not have a method for fetching it other than an existing entity; I SWEAR) #41

Closed Shibva closed 7 months ago

Shibva commented 7 months ago

as the title insinuates; ITeam is a very niche thing used and even when I tried to use it I found it frustrating because of one thing; there is no method to call an ITeam object in the script. To elaborate; imagine this: imagine you have to make a script involving a team setup system and you cant use commandManager to use commands but the world will already have a team space in its scoreboard for them to be put in. The question is how? there is a setter .setTeam() that requires an ITeam object to use; but where would you get it? from an entity? well no entity has it set yet and trying to fetch it without a team will return null. Your thinking would be to call it using global functions like server.world or game. You be right BUT YOU CAN'N! there IS NO METHOD todo such so its IMPOSIBLE to do it in zen using pure script wtihout the use of commandManager and even then you would require AT LEAST ONE ENITTY to fetch a ITeam object that cant be stored (sure you could in customWorldData but for the sake of example and simplicity sake lets pretend we cant do that). Thus lies the problem; it seems that some of these things that would have been important were left out.

and thats where this mod comes in by expanding on those things to impliment the missing stuff that SHOULD have been there to begin with (how it was though to be OK as it was is beyond me, its a bit maddening)

friendlyhj commented 7 months ago
world.teams
world.getTeam("foo")
world.createTeam("foo")
world.removeTeam("foo")