Dev Examples: Difference between revisions
Jump to navigation
Jump to search
Marcely1199 (talk | contribs) (Replaced content with "=== Check if this plugin is existing === { lol }") |
Marcely1199 (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
=== Check if this plugin is existing === | === Check if this plugin is existing (v.1.6+)=== | ||
{ | if(Bukkit.getServer().getPluginManager().getPlugin("GroupManager") != null) | ||
// exists | |||
else | |||
// deosn't exist | |||
=== Get the status of an arena (v.1.6+)=== | |||
String name = "example"; | |||
System.out.println("This arena is currently " + BedwarsAPI.getArena(name).getStatus().name()); | |||
=== Create own extra-item (v.2.2+)=== | |||
ExtraItem item = new ExtraItem("TextWhenBuyingIt", new ItemStack(Material.DIRT, 1)){ | |||
@Override | |||
public void onBuyEvent(BuyEvent event){ | |||
event.getBuyer().sendMessage("OMG! It's working!"); | |||
} | |||
} | } | ||
BedwarsAPI.registerExtraItem(item); | |||
=== Create own spawner (v.2.2+)=== |
Revision as of 20:45, 8 May 2016
Check if this plugin is existing (v.1.6+)
if(Bukkit.getServer().getPluginManager().getPlugin("GroupManager") != null)
// exists
else
// deosn't exist
Get the status of an arena (v.1.6+)
String name = "example"; System.out.println("This arena is currently " + BedwarsAPI.getArena(name).getStatus().name());
Create own extra-item (v.2.2+)
ExtraItem item = new ExtraItem("TextWhenBuyingIt", new ItemStack(Material.DIRT, 1)){
@Override public void onBuyEvent(BuyEvent event){ event.getBuyer().sendMessage("OMG! It's working!"); }
} BedwarsAPI.registerExtraItem(item);