Dev Examples: Difference between revisions
Jump to navigation
Jump to search
Marcely1199 (talk | contribs) No edit summary |
Marcely1199 (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
=== Check if this plugin is existing (v.1.6+)=== | === Check if this plugin is existing (v.1.6+)=== | ||
if(Bukkit.getServer().getPluginManager().getPlugin("GroupManager") != null) | if(Bukkit.getServer().getPluginManager().getPlugin("GroupManager") != null) | ||
// exists | |||
else | else | ||
// deosn't exist | |||
=== Get the status of an arena (v.1.6+)=== | === Get the status of an arena (v.1.6+)=== | ||
String name = "example"; | String name = "example"; | ||
System.out.println("This arena is currently " + BedwarsAPI.getArena(name).getStatus().name()); | System.out.println("This arena is currently " + BedwarsAPI.getArena(name).getStatus().name()); | ||
=== Create own extra-item (v.2.2+)=== | === Create own extra-item (v.2.2+)=== | ||
ExtraItem item = new ExtraItem("TextWhenBuyingIt", new ItemStack(Material.DIRT, 1)){ | 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); | BedwarsAPI.registerExtraItem(item); | ||
=== Create own spawner (v.2.2+)=== | === Create own spawner (v.2.2+)=== |
Revision as of 20:46, 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);