Developers
API Examples
Paintball and Spleef.
WIKI on API
Source
Add on Plugins Source
Why use Arenas as a platform?
- No need to worry about teleportation
- or teams
- or who is in your event or not
- or giving people items or prizes.
- or spawning items/mobs
- efficient and fast (see below)
- Much less code to write for yourself
Essentially, you can cut out 90% of the code and worry on making your event Unique.
EVERY bukkit event can be overridden and if it has the pragma @MatchEventHandler above it, you will only get that bukkit event for players that are still INSIDE your event.
Despite its size this plugin is very efficient and uses almost zero processor time (on one day 1000+ matches happened with <2 seconds used for the entire day on the bukkit profiler). This is because the plugin removes all listeners that are not currently being used so that no cycles are used when a bukkit event doesn't need to be listened for.
The Paintball plugin takes less than 20 lines of code. The number of teams, size of teams, teleportation, inventory handling, victory prizes and loser prizes, are all configurable like normal through the config
The Spleef is slightly more complicated because you need to be able to type commands, and regenerate layers, etc. But the amount of code is very small compared to what would normally be required.
Full working Paintball plugin code
public class Paintball extends JavaPlugin{ static int damage = 20; @Override public void onEnable(){ BattleArena.registerMatchType( this, "Paintball", "pb", PaintballArena.class); damage = getConfig().getInt("damage", 20); } public class PaintballArena extends Arena{ @MatchEventHandler public void onEntityDamage(EntityDamageByEntityEvent event) { if (event.isCancelled()) return; if (event.getDamager().getType() != EntityType.SNOWBALL) return; event.setDamage(damage); } } }
This seems REALLY awesome, have i the permission to TRY to make a new arena type? But i'm not very experienced in bukkit plugins, so don't expect to much ;)
I am not sure whether you meant to say this, but if you look up when you are talking about the lack of lag, you say "(on one day 1000+ matches happened with <2 seconds used for the entire day on the bukkit profiler)". If you notice, "<2 seconds" means more than two seconds, does this mean a little bit less than 3 seconds or is that just a mistake?
How can I make this into a Cookie slap sort of plugin?
@boboman13
"<2 seconds" means less than two seconds, not more.
Looks great! I'm really thinking about making a few plugins! :)
Is there anyway to change trajectory of entities?(Such as a firework for QuakeCraft) If not ADD THAT, I could think of a lot of games that could use that. Like a pig spawner egg that could shoot pigs at a certain angle. And is there an item changer? Such as, using a clock(example) to spawn the pig mentioned before.
And I have to say, I am impressed on how short the code is! Using this, people could make so much stuff! I read the entire Wiki(which takes 5 seconds), and I was surprised! IT'S SO SHORT!