Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. if (e.getClickedInventory().getTitle().equals("§b§lSchwerter")) {
  2. e.setCancelled(true);
  3. if (e.getCurrentItem().getType() == Material.IRON_SWORD) {
  4. if (e.getCurrentItem().getItemMeta().getDisplayName().equalsIgnoreCase("§aNormales-Schwert")) {
  5. if (TokenAPI.getBalance(p) >= 500) {
  6. TokenAPI.takeBalance(p, 500);
  7. ItemStack ironschwert1 = new ItemStack(Material.IRON_SWORD);
  8. ItemMeta ironschwert1Meta = ironschwert1.getItemMeta();
  9. ironschwert1Meta.setDisplayName("§aNormales-Schwert");
  10. ironschwert1.setItemMeta(ironschwert1Meta);
  11. p.getInventory().addItem(ironschwert1);
  12. p.playSound(p.getLocation(), Sound.LEVEL_UP, 2F, 1F);
  13. p.sendMessage(Main.Prefix + "§aDu hast dir erfolgreich das §aNormale-Schwert §agekauft!");
  14. p.closeInventory();
  15. } else {
  16. p.sendMessage(Main.Prefix + "§cDu hast nicht genug Tokens! Du benötigst §a500-Tokens §cdafür!");
  17. }
  18. }
  19.  
  20.  
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement