garbagemule / MobArena

MobArena plugin for Minecraft
GNU General Public License v3.0
195 stars 150 forks source link

API to be used with command blocks #455

Open Swatacular opened 6 years ago

Swatacular commented 6 years ago

Summary

Background

Feature request

What does it do?: Addition of an ingame API using "objectives" for command blocks to test for and run commands from. For example "player" name: MAmyfirstarena (MA + whatever the name of the arena is) "objective" name: WaveCount "objective" name: RemainingPlayers "objective" name: KilledEnemies

2nd arena: playername: MA_coolarena and so on.

Does it need new or changed commands? What are they?: Doesn't need any new commands. not even necessarily a config change either.

Does this feature affect other parts of MobArena?: No

garbagemule commented 6 years ago

This sounds interesting. So the idea is to feed MobArena variables into Objectives on a Scoreboard, and that just automagically makes it possible to extract those values in command blocks? I've never worked with command blocks, and my experience with Objectives is limited to single-objective scoreboards in MobArena.

If other plugins offer something similar, please link to the repositories so people can check out how it works.

Also please provide some concrete examples. What, specifically, can you do with this, why would you want to do it, and how do you set everything up to realize this idea, assuming everything works plugin-side?

Swatacular commented 6 years ago

I have not used the command block syntax since I posted this suggestion, but here is the rundown.

"Objectives" Have 3 separate factors

"Player Name" ---"Objective Name" -------"Number Value"

Command blocks can use any of those three factors to create objectives for players that don't exist.

For example,

"aFakeName" ---"aFakeObjective" -------"1337"

Command blocks have a "Test for" command which allows them to check a specific value for a specific objective, and then do a command or series of commands afterwards (which is up to the sever admin)

So if "aFakeName" . "aFakeObjective" . Value then Run following commands "//Paste arena1 at arena1 position" (Effectively resetting the arena)

Here is an example of what I might use this for If you had the objective "player names" as the arenas. And then the specific values as things like what wave they are on.. I could do something like this.

if "Myarena1" . "Wavecount" . Value = 10 then //give all players within arena border potion effect xyz

This will allow me to heal/promote players within the arena using custom potions, items and effects without altering the config file or requiring much work from the developer of the plugin when minecraft is updated.