Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $b = Block::get(57);
- $item->setCount($item->getCount() - 1);
- $player->getInventory()->setItem($player->getInventory()->getHeldItemSlot(), $item);
- $level->addSound(new FizzSound($player));
- $level->addParticle(new DestroyBlockParticle($pos, $b));
- $event->setCancelled(true);
- }
- //RARE CRATE KEY
- if($item->getName() == "§6Rare Key"){
- $reward = rand(1,17);
- switch($reward){
- case 1:
- $text = "item";
- $item2 = Item::get(52,0,1);
- $name = "spawner";
- $this->spawnItem($block, $item2, $player);
- $this->spawnOpenChest($player, $block);
- $this->spawnNamedText($block, $player, $text);
- $this->spawnNamedChest($block, $player, $name);
- $this->setAllowed($player, false);
- $player->sendMessage(C::GREEN . "You Opened A §6Rare Crate!");
- $player->getInventory()->addItem($item2);
- $this->getServer()->getScheduler()->scheduleDelayedTask(new CloseChest($this, $player, $block), 60 * 3);
- $this->getServer()->getScheduler()->scheduleDelayedTask(new CoolDown($this, $player), 10 * 20);
- break;
- case 2:
- $text = "item";
- $item2 = Item::get(322,0,10);
- $name = "10 gapples";
- $this->spawnItem($block, $item2, $player);
- $this->spawnOpenChest($player, $block);
- $this->spawnNamedText($block, $player, $text);
- $this->spawnNamedChest($block, $player, $name);
- $this->setAllowed($player, false);
- $player->sendMessage(C::GREEN . "You Opened A §6Rare Crate!");
- $player->getInventory()->addItem($item2);
- $this->getServer()->getScheduler()->scheduleDelayedTask(new CloseChest($this, $player, $block), 60 * 3);
- $this->getServer()->getScheduler()->scheduleDelayedTask(new CoolDown($this, $player), 10 * 20);
- break;
- case 3:
- $text = "item";
- $item2 = Item::get(322,0,20);
- $name = "20 gapples";
- $this->spawnItem($block, $item2, $player);
- $this->spawnOpenChest($player, $block);
- $this->spawnNamedText($block, $player, $text);
- $this->spawnNamedChest($block, $player, $name);
- $this->setAllowed($player, false);
- $player->sendMessage(C::GREEN . "You Opened A §6Rare Crate!");
- $player->getInventory()->addItem($item2);
- $this->getServer()->getScheduler()->scheduleDelayedTask(new CloseChest($this, $player, $block), 60 * 3);
- $this->getServer()->getScheduler()->scheduleDelayedTask(new CoolDown($this, $player), 10 * 20);
- break;
- case 4:
- $text = "item";
- $item2 = Item::get(322,0,30);
- $name = "30 gapples";
- $this->spawnItem($block, $item2, $player);
- $this->spawnOpenChest($player, $block);
- $this->spawnNamedText($block, $player, $text);
- $this->spawnNamedChest($block, $player, $name);
- $this->setAllowed($player, false);
- $player->sendMessage(C::GREEN . "You Opened A §6Rare Crate!");
- $player->getInventory()->addItem($item2);
- $this->getServer()->getScheduler()->scheduleDelayedTask(new CloseChest($this, $player, $block), 60 * 3);
- $this->getServer()->getScheduler()->scheduleDelayedTask(new CoolDown($this, $player), 10 * 20);
- break;
- case 5:
- $text = "item";
- $item2 = Item::get(466,0,1);
- $name = "1 god apple";
- $this->spawnItem($block, $item2, $player);
- $this->spawnOpenChest($player, $block);
- $this->spawnNamedText($block, $player, $text);
- $this->spawnNamedChest($block, $player, $name);
- $this->setAllowed($player, false);
- $player->sendMessage(C::GREEN . "You Opened A §6Rare Crate!");
- $player->getInventory()->addItem($item2);
- $this->getServer()->getScheduler()->scheduleDelayedTask(new CloseChest($this, $player, $block), 60 * 3);
- $this->getServer()->getScheduler()->scheduleDelayedTask(new CoolDown($this, $player), 10 * 20);
- break;
- case 6:
- $text = "item";
- $item2 = Item::get(466,0,2);
- $name = "2 god apple";
- $this->spawnItem($block, $item2, $player);
- $this->spawnOpenChest($player, $block);
- $this->spawnNamedText($block, $player, $text);
- $this->spawnNamedChest($block, $player, $name);
- $this->setAllowed($player, false);
- $player->sendMessage(C::GREEN . "You Opened A §6Rare Crate!");
- $player->getInventory()->addItem($item2);
- $this->getServer()->getScheduler()->scheduleDelayedTask(new CloseChest($this, $player, $block), 60 * 3);
- $this->getServer()->getScheduler()->scheduleDelayedTask(new CoolDown($this, $player), 10 * 20);
- break;
- case 7:
- $text = "item";
- $item2 = Item::get(7,0,1);
- $name = "1 bedrock";
- $this->spawnItem($block, $item2, $player);
- $this->spawnOpenChest($player, $block);
- $this->spawnNamedText($block, $player, $text);
- $this->spawnNamedChest($block, $player, $name);
- $this->setAllowed($player, false);
- $player->sendMessage(C::GREEN . "You Opened A §6Rare Crate!");
- $player->getInventory()->addItem($item2);
- $this->getServer()->getScheduler()->scheduleDelayedTask(new CloseChest($this, $player, $block), 60 * 3);
- $this->getServer()->getScheduler()->scheduleDelayedTask(new CoolDown($this, $player), 10 * 20);
- break;
- case 8:
- $text = "item";
- $item2 = Item::get(7,0,2);
- $name = "2 bedrock";
- $this->spawnItem($block, $item2, $player);
- $this->spawnOpenChest($player, $block);
- $this->spawnNamedText($block, $player, $text);
- $this->spawnNamedChest($block, $player, $name);
- $this->setAllowed($player, false);
- $player->sendMessage(C::GREEN . "You Opened A §6Rare Crate!");
- $player->getInventory()->addItem($item2);
- $this->getServer()->getScheduler()->scheduleDelayedTask(new CloseChest($this, $player, $block), 60 * 3);
- $this->getServer()->getScheduler()->scheduleDelayedTask(new CoolDown($this, $player), 10 * 20);
- break;
- case 9:
- $text = "item";
- $item2 = Item::get(52,0,2);
- $name = "2 spawners";
- $this->spawnItem($block, $item2, $player);
- $this->spawnOpenChest($player, $block);
- $this->spawnNamedText($block, $player, $text);
- $this->spawnNamedChest($block, $player, $name);
- $this->setAllowed($player, false);
- $player->sendMessage(C::GREEN . "You Opened A §6Rare Crate!");
- $player->getInventory()->addItem($item2);
- $this->getServer()->getScheduler()->scheduleDelayedTask(new CloseChest($this, $player, $block), 60 * 3);
- $this->getServer()->getScheduler()->scheduleDelayedTask(new CoolDown($this, $player), 10 * 20);
- break;
- case 10:
- $text = "§bItem";
- $helmet = Item::get(310,0,1);
- $item2 = Item::get(311,0,1);
- $leggings = Item::get(312,0,1);
- $shoes = Item::get(313,0,1);
- $pickaxe = Item::get(278,0,1);
- $sword = Item::get(276,0,1);
- $apples = Item::get(322,0,1);
- $name = "dans special";
- $enchant = Enchantment::getEnchantment(0);
- $enchant->setLevel(3);
- $helmet->addEnchantment($enchant);
- $item2->addEnchantment($enchant);
- $leggings->addEnchantment($enchant);
- $shoes->addEnchantment($enchant);
- $enchant = Enchantment::getEnchantment(15);
- $enchant->setLevel(3);
- $pickaxe->addEnchantment($enchant);
- $enchant = Enchantment::getEnchantment(9);
- $enchant->setLevel(3);
- $sword->addEnchantment($enchant);
- $this->spawnItem($block, $item2, $player);
- $this->spawnOpenChest($player, $block);
- $this->spawnNamedText($block, $player, $text);
- $this->setAllowed($player, false);
- $player->sendMessage(C::GREEN . "You Opened A §7Common Crate! §aThanks for Voting!");
- $player->getInventory()->addItem($helmet);
- $player->getInventory()->addItem($item2);
- $player->getInventory()->addItem($leggings);
- $player->getInventory()->addItem($shoes);
- $player->getInventory()->addItem($pickaxe);
- $player->getInventory()->addItem($sword);
- $player->getInventory()->addItem($apples);
- $this->getServer()->getScheduler()->scheduleDelayedTask(new CloseChest($this, $player, $block), 60 * 3);
- $this->getServer()->getScheduler()->scheduleDelayedTask(new CoolDown($this, $player), 10 * 20);
- break;
- case 11:
- $text = "§bItem";
- $helmet = Item::get(310,0,1);
- $item2 = Item::get(311,0,1);
- $leggings = Item::get(312,0,1);
- $shoes = Item::get(313,0,1);
- $name = "Prot 4";
- $enchant = Enchantment::getEnchantment(0);
- $enchant->setLevel(4);
- $helmet->addEnchantment($enchant);
- $item2->addEnchantment($enchant);
- $leggings->addEnchantment($enchant);
- $shoes->addEnchantment($enchant);
- $this->spawnItem($block, $item2, $player);
- $this->spawnOpenChest($player, $block);
- $this->spawnNamedText($block, $player, $text);
- $this->setAllowed($player, false);
- $player->sendMessage(C::GREEN . "You Opened A §7Common Crate! §aThanks for Voting!");
- $player->getInventory()->addItem($helmet);
- $player->getInventory()->addItem($item2);
- $player->getInventory()->addItem($leggings);
- $player->getInventory()->addItem($shoes);
- $this->getServer()->getScheduler()->scheduleDelayedTask(new CloseChest($this, $player, $block), 60 * 3);
- $this->getServer()->getScheduler()->scheduleDelayedTask(new CoolDown($this, $player), 10 * 20);
- break;
- case 12:
- $text = "item";
- $item2 = Item::get(131,0,2);
- $name = "2 rare";
- $this->setCustomName("§6Rare Key");
- $this->spawnItem($block, $item2, $player);
- $this->spawnOpenChest($player, $block);
- $this->spawnNamedText($block, $player, $text);
- $this->spawnNamedChest($block, $player, $name);
- $this->setAllowed($player, false);
- $player->sendMessage(C::GREEN . "You Opened A §6Rare Crate!");
- $player->getInventory()->addItem($item2);
- $this->getServer()->getScheduler()->scheduleDelayedTask(new CloseChest($this, $player, $block), 60 * 3);
- $this->getServer()->getScheduler()->scheduleDelayedTask(new CoolDown($this, $player), 10 * 20);
- break;
- case 13:
- $text = "item";
- $item2 = Item::get(391,0,2000);
- $name = "2000 carrot";
- $this->spawnItem($block, $item2, $player);
- $this->spawnOpenChest($player, $block);
- $this->spawnNamedText($block, $player, $text);
- $this->spawnNamedChest($block, $player, $name);
- $this->setAllowed($player, false);
- $player->sendMessage(C::GREEN . "You Opened A §6Rare Crate!");
- $player->getInventory()->addItem($item2);
- $this->getServer()->getScheduler()->scheduleDelayedTask(new CloseChest($this, $player, $block), 60 * 3);
- $this->getServer()->getScheduler()->scheduleDelayedTask(new CoolDown($this, $player), 10 * 20);
- break;
- case 14:
- $text = "item";
- $item2 = Item::get(49,0,128);
- $name = "64 obby x2";
- $this->spawnItem($block, $item2, $player);
- $this->spawnOpenChest($player, $block);
- $this->spawnNamedText($block, $player, $text);
- $this->spawnNamedChest($block, $player, $name);
- $this->setAllowed($player, false);
- $player->sendMessage(C::GREEN . "You Opened A §6Rare Crate!");
- $player->getInventory()->addItem($item2);
- $this->getServer()->getScheduler()->scheduleDelayedTask(new CloseChest($this, $player, $block), 60 * 3);
- $this->getServer()->getScheduler()->scheduleDelayedTask(new CoolDown($this, $player), 10 * 20);
- break;
- case 15:
- $text = "item";
- $item2 = Item::get(46,0,30);
- $name = "30 tnt";
- $this->spawnItem($block, $item2, $player);
- $this->spawnOpenChest($player, $block);
- $this->spawnNamedText($block, $player, $text);
- $this->spawnNamedChest($block, $player, $name);
- $this->setAllowed($player, false);
- $player->sendMessage(C::GREEN . "You Opened A §6Rare Crate!");
- $player->getInventory()->addItem($item2);
- $this->getServer()->getScheduler()->scheduleDelayedTask(new CloseChest($this, $player, $block), 60 * 3);
- $this->getServer()->getScheduler()->scheduleDelayedTask(new CoolDown($this, $player), 10 * 20);
- break;
- case 16:
- $text = "item";
- $item2 = Item::get(46,0,30);
- $name = "40 tnt";
- $this->spawnItem($block, $item2, $player);
- $this->spawnOpenChest($player, $block);
- $this->spawnNamedText($block, $player, $text);
- $this->spawnNamedChest($block, $player, $name);
- $this->setAllowed($player, false);
- $player->sendMessage(C::GREEN . "You Opened A §6Rare Crate!");
- $player->getInventory()->addItem($item2);
- $this->getServer()->getScheduler()->scheduleDelayedTask(new CloseChest($this, $player, $block), 60 * 3);
- $this->getServer()->getScheduler()->scheduleDelayedTask(new CoolDown($this, $player), 10 * 20);
- break;
- case 17:
- $text = "item";
- $item2 = Item::get(131,0,2);
- $name = "2 uncommon";
- $item->setCustomName("§bUncommon Key");
- $this->spawnItem($block, $item2, $player);
- $this->spawnOpenChest($player, $block);
- $this->spawnNamedText($block, $player, $text);
- $this->spawnNamedChest($block, $player, $name);
- $this->setAllowed($player, false);
- $player->sendMessage(C::GREEN . "You Opened A §6Rare Crate!");
- $player->getInventory()->addItem($item2);
- $this->getServer()->getScheduler()->scheduleDelayedTask(new CloseChest($this, $player, $block), 60 * 3);
- $this->getServer()->getScheduler()->scheduleDelayedTask(new CoolDown($this, $player), 10 * 20);
- break;
- case 18:
- $text = "item";
- $item2 = Item::get(131,0,3);
- $name = "3 uncommon";
- $item->setCustomName("§bUncommon Key");
- $this->spawnItem($block, $item2, $player);
- $this->spawnOpenChest($player, $block);
- $this->spawnNamedText($block, $player, $text);
- $this->spawnNamedChest($block, $player, $name);
- $this->setAllowed($player, false);
- $player->sendMessage(C::GREEN . "You Opened A §6Rare Crate!");
- $player->getInventory()->addItem($item2);
- $this->getServer()->getScheduler()->scheduleDelayedTask(new CloseChest($this, $player, $block), 60 * 3);
- $this->getServer()->getScheduler()->scheduleDelayedTask(new CoolDown($this, $player), 10 * 20);
- break;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement