Dev Examples
! Legacy Warning !You are currently visiting a prehistoric website of the Marcely's Bedwars plugin for v4 and older. In 2021, we released version 5 and completely overhauled the wiki. A lot of information that you find here likely won't be up-to-date anymore. You may find the updated wiki on: https://wiki.mbedwars.com |
Check if this plugin is existing (v.1.6+)
import org.bukkit.Bukkit;
if(Bukkit.getServer().getPluginManager().getPlugin("GroupManager") != null) // exists else // deosn't exist
Get the status of an arena (v.1.6+)
import de.marcely.bedwars.api.BedwarsAPI;
BedwarsAPI api = new BedwarsAPI(); String name = "example"; System.out.println("This arena is currently " + api.getArena(name).getStatus().name());
Create own extra-item (v.2.2+)
import org.bukkit.Material; import org.bukkit.inventory.ItemStack; import de.marcely.bedwars.api.BedwarsAPI; import de.marcely.bedwars.api.BuyEvent; import de.marcely.bedwars.api.ExtraItem;
BedwarsAPI api = new BedwarsAPI(); ExtraItem item = new ExtraItem("TextWhenBuyingIt", new ItemStack(Material.DIRT, 1)){ @Override public void onBuyEvent(BuyEvent event){ event.getBuyer().sendMessage("OMG! It's working!"); } } api.registerExtraItem(item);