Advertisement
Guest User

Untitled

a guest
Jan 13th, 2017
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 15.72 KB | None | 0 0
  1. $b = Block::get(57);
  2.    $item->setCount($item->getCount() - 1);
  3.             $player->getInventory()->setItem($player->getInventory()->getHeldItemSlot(), $item);
  4.           $level->addSound(new FizzSound($player));
  5.           $level->addParticle(new DestroyBlockParticle($pos, $b));
  6.         $event->setCancelled(true);
  7.         }
  8.         //RARE CRATE KEY
  9.         if($item->getName() == "§6Rare Key"){
  10.           $reward = rand(1,17);
  11.           switch($reward){
  12.           case 1:
  13.            $text = "item";
  14.            $item2 = Item::get(52,0,1);
  15.            $name = "spawner";
  16.            $this->spawnItem($block, $item2, $player);
  17.            $this->spawnOpenChest($player, $block);
  18.            $this->spawnNamedText($block, $player, $text);
  19.            $this->spawnNamedChest($block, $player, $name);
  20.            $this->setAllowed($player, false);
  21.            $player->sendMessage(C::GREEN . "You Opened A §6Rare Crate!");
  22.            $player->getInventory()->addItem($item2);
  23.            $this->getServer()->getScheduler()->scheduleDelayedTask(new CloseChest($this, $player, $block), 60 * 3);
  24.            $this->getServer()->getScheduler()->scheduleDelayedTask(new CoolDown($this, $player), 10 * 20);
  25.           break;
  26.           case 2:
  27.            $text = "item";
  28.            $item2 = Item::get(322,0,10);
  29.            $name = "10 gapples";
  30.            $this->spawnItem($block, $item2, $player);
  31.            $this->spawnOpenChest($player, $block);
  32.            $this->spawnNamedText($block, $player, $text);
  33.            $this->spawnNamedChest($block, $player, $name);
  34.            $this->setAllowed($player, false);
  35.            $player->sendMessage(C::GREEN . "You Opened A §6Rare Crate!");
  36.            $player->getInventory()->addItem($item2);
  37.            $this->getServer()->getScheduler()->scheduleDelayedTask(new CloseChest($this, $player, $block), 60 * 3);
  38.            $this->getServer()->getScheduler()->scheduleDelayedTask(new CoolDown($this, $player), 10 * 20);
  39.           break;
  40.           case 3:
  41.            $text = "item";
  42.            $item2 = Item::get(322,0,20);
  43.            $name = "20 gapples";
  44.            $this->spawnItem($block, $item2, $player);
  45.            $this->spawnOpenChest($player, $block);
  46.            $this->spawnNamedText($block, $player, $text);
  47.            $this->spawnNamedChest($block, $player, $name);
  48.            $this->setAllowed($player, false);
  49.            $player->sendMessage(C::GREEN . "You Opened A §6Rare Crate!");
  50.            $player->getInventory()->addItem($item2);
  51.            $this->getServer()->getScheduler()->scheduleDelayedTask(new CloseChest($this, $player, $block), 60 * 3);
  52.            $this->getServer()->getScheduler()->scheduleDelayedTask(new CoolDown($this, $player), 10 * 20);
  53.           break;
  54.           case 4:
  55.            $text = "item";
  56.            $item2 = Item::get(322,0,30);
  57.            $name = "30 gapples";
  58.            $this->spawnItem($block, $item2, $player);
  59.            $this->spawnOpenChest($player, $block);
  60.            $this->spawnNamedText($block, $player, $text);
  61.            $this->spawnNamedChest($block, $player, $name);
  62.            $this->setAllowed($player, false);
  63.            $player->sendMessage(C::GREEN . "You Opened A §6Rare Crate!");
  64.            $player->getInventory()->addItem($item2);
  65.            $this->getServer()->getScheduler()->scheduleDelayedTask(new CloseChest($this, $player, $block), 60 * 3);
  66.            $this->getServer()->getScheduler()->scheduleDelayedTask(new CoolDown($this, $player), 10 * 20);
  67.           break;
  68.           case 5:
  69.            $text = "item";
  70.            $item2 = Item::get(466,0,1);
  71.            $name = "1 god apple";
  72.            $this->spawnItem($block, $item2, $player);
  73.            $this->spawnOpenChest($player, $block);
  74.            $this->spawnNamedText($block, $player, $text);
  75.            $this->spawnNamedChest($block, $player, $name);
  76.            $this->setAllowed($player, false);
  77.            $player->sendMessage(C::GREEN . "You Opened A §6Rare Crate!");
  78.            $player->getInventory()->addItem($item2);
  79.            $this->getServer()->getScheduler()->scheduleDelayedTask(new CloseChest($this, $player, $block), 60 * 3);
  80.            $this->getServer()->getScheduler()->scheduleDelayedTask(new CoolDown($this, $player), 10 * 20);
  81.           break;
  82.           case 6:
  83.            $text = "item";
  84.            $item2 = Item::get(466,0,2);
  85.            $name = "2 god apple";
  86.            $this->spawnItem($block, $item2, $player);
  87.            $this->spawnOpenChest($player, $block);
  88.            $this->spawnNamedText($block, $player, $text);
  89.            $this->spawnNamedChest($block, $player, $name);
  90.            $this->setAllowed($player, false);
  91.            $player->sendMessage(C::GREEN . "You Opened A §6Rare Crate!");
  92.            $player->getInventory()->addItem($item2);
  93.            $this->getServer()->getScheduler()->scheduleDelayedTask(new CloseChest($this, $player, $block), 60 * 3);
  94.            $this->getServer()->getScheduler()->scheduleDelayedTask(new CoolDown($this, $player), 10 * 20);
  95.           break;
  96.           case 7:
  97.            $text = "item";
  98.            $item2 = Item::get(7,0,1);
  99.            $name = "1 bedrock";
  100.            $this->spawnItem($block, $item2, $player);
  101.            $this->spawnOpenChest($player, $block);
  102.            $this->spawnNamedText($block, $player, $text);
  103.            $this->spawnNamedChest($block, $player, $name);
  104.            $this->setAllowed($player, false);
  105.            $player->sendMessage(C::GREEN . "You Opened A §6Rare Crate!");
  106.            $player->getInventory()->addItem($item2);
  107.            $this->getServer()->getScheduler()->scheduleDelayedTask(new CloseChest($this, $player, $block), 60 * 3);
  108.            $this->getServer()->getScheduler()->scheduleDelayedTask(new CoolDown($this, $player), 10 * 20);
  109.           break;
  110.           case 8:
  111.            $text = "item";
  112.            $item2 = Item::get(7,0,2);
  113.            $name = "2 bedrock";
  114.            $this->spawnItem($block, $item2, $player);
  115.            $this->spawnOpenChest($player, $block);
  116.            $this->spawnNamedText($block, $player, $text);
  117.            $this->spawnNamedChest($block, $player, $name);
  118.            $this->setAllowed($player, false);
  119.            $player->sendMessage(C::GREEN . "You Opened A §6Rare Crate!");
  120.            $player->getInventory()->addItem($item2);
  121.            $this->getServer()->getScheduler()->scheduleDelayedTask(new CloseChest($this, $player, $block), 60 * 3);
  122.            $this->getServer()->getScheduler()->scheduleDelayedTask(new CoolDown($this, $player), 10 * 20);
  123.           break;
  124.           case 9:
  125.            $text = "item";
  126.            $item2 = Item::get(52,0,2);
  127.            $name = "2 spawners";
  128.            $this->spawnItem($block, $item2, $player);
  129.            $this->spawnOpenChest($player, $block);
  130.            $this->spawnNamedText($block, $player, $text);
  131.            $this->spawnNamedChest($block, $player, $name);
  132.            $this->setAllowed($player, false);
  133.            $player->sendMessage(C::GREEN . "You Opened A §6Rare Crate!");
  134.            $player->getInventory()->addItem($item2);
  135.            $this->getServer()->getScheduler()->scheduleDelayedTask(new CloseChest($this, $player, $block), 60 * 3);
  136.            $this->getServer()->getScheduler()->scheduleDelayedTask(new CoolDown($this, $player), 10 * 20);
  137.           break;
  138.           case 10:
  139.            $text = "§bItem";
  140.            $helmet = Item::get(310,0,1);
  141.            $item2 = Item::get(311,0,1);
  142.            $leggings = Item::get(312,0,1);
  143.            $shoes = Item::get(313,0,1);
  144.            $pickaxe = Item::get(278,0,1);
  145.            $sword = Item::get(276,0,1);
  146.            $apples = Item::get(322,0,1);
  147.            $name = "dans special";
  148.            $enchant = Enchantment::getEnchantment(0);
  149.            $enchant->setLevel(3);
  150.            $helmet->addEnchantment($enchant);
  151.            $item2->addEnchantment($enchant);
  152.            $leggings->addEnchantment($enchant);
  153.            $shoes->addEnchantment($enchant);
  154.            $enchant = Enchantment::getEnchantment(15);
  155.            $enchant->setLevel(3);
  156.            $pickaxe->addEnchantment($enchant);
  157.            $enchant = Enchantment::getEnchantment(9);
  158.            $enchant->setLevel(3);
  159.            $sword->addEnchantment($enchant);
  160.            $this->spawnItem($block, $item2, $player);
  161.            $this->spawnOpenChest($player, $block);
  162.            $this->spawnNamedText($block, $player, $text);
  163.            $this->setAllowed($player, false);
  164.            $player->sendMessage(C::GREEN . "You Opened A §7Common Crate! §aThanks for Voting!");
  165.            $player->getInventory()->addItem($helmet);
  166.            $player->getInventory()->addItem($item2);
  167.            $player->getInventory()->addItem($leggings);
  168.            $player->getInventory()->addItem($shoes);
  169.            $player->getInventory()->addItem($pickaxe);
  170.            $player->getInventory()->addItem($sword);
  171.            $player->getInventory()->addItem($apples);
  172.            $this->getServer()->getScheduler()->scheduleDelayedTask(new CloseChest($this, $player, $block), 60 * 3);
  173.            $this->getServer()->getScheduler()->scheduleDelayedTask(new CoolDown($this, $player), 10 * 20);
  174.           break;
  175.           case 11:
  176.            $text = "§bItem";
  177.            $helmet = Item::get(310,0,1);
  178.            $item2 = Item::get(311,0,1);
  179.            $leggings = Item::get(312,0,1);
  180.            $shoes = Item::get(313,0,1);
  181.            $name = "Prot 4";
  182.            $enchant = Enchantment::getEnchantment(0);
  183.            $enchant->setLevel(4);
  184.            $helmet->addEnchantment($enchant);
  185.            $item2->addEnchantment($enchant);
  186.            $leggings->addEnchantment($enchant);
  187.            $shoes->addEnchantment($enchant);
  188.            $this->spawnItem($block, $item2, $player);
  189.            $this->spawnOpenChest($player, $block);
  190.            $this->spawnNamedText($block, $player, $text);
  191.            $this->setAllowed($player, false);
  192.            $player->sendMessage(C::GREEN . "You Opened A §7Common Crate! §aThanks for Voting!");
  193.            $player->getInventory()->addItem($helmet);
  194.            $player->getInventory()->addItem($item2);
  195.            $player->getInventory()->addItem($leggings);
  196.            $player->getInventory()->addItem($shoes);
  197.            $this->getServer()->getScheduler()->scheduleDelayedTask(new CloseChest($this, $player, $block), 60 * 3);
  198.            $this->getServer()->getScheduler()->scheduleDelayedTask(new CoolDown($this, $player), 10 * 20);
  199.           break;
  200.           case 12:
  201.            $text = "item";
  202.            $item2 = Item::get(131,0,2);
  203.            $name = "2 rare";
  204.            $this->setCustomName("§6Rare Key");
  205.            $this->spawnItem($block, $item2, $player);
  206.            $this->spawnOpenChest($player, $block);
  207.            $this->spawnNamedText($block, $player, $text);
  208.            $this->spawnNamedChest($block, $player, $name);
  209.            $this->setAllowed($player, false);
  210.            $player->sendMessage(C::GREEN . "You Opened A §6Rare Crate!");
  211.            $player->getInventory()->addItem($item2);
  212.            $this->getServer()->getScheduler()->scheduleDelayedTask(new CloseChest($this, $player, $block), 60 * 3);
  213.            $this->getServer()->getScheduler()->scheduleDelayedTask(new CoolDown($this, $player), 10 * 20);
  214.           break;
  215.           case 13:
  216.            $text = "item";
  217.            $item2 = Item::get(391,0,2000);
  218.            $name = "2000 carrot";
  219.            $this->spawnItem($block, $item2, $player);
  220.            $this->spawnOpenChest($player, $block);
  221.            $this->spawnNamedText($block, $player, $text);
  222.            $this->spawnNamedChest($block, $player, $name);
  223.            $this->setAllowed($player, false);
  224.            $player->sendMessage(C::GREEN . "You Opened A §6Rare Crate!");
  225.            $player->getInventory()->addItem($item2);
  226.            $this->getServer()->getScheduler()->scheduleDelayedTask(new CloseChest($this, $player, $block), 60 * 3);
  227.            $this->getServer()->getScheduler()->scheduleDelayedTask(new CoolDown($this, $player), 10 * 20);
  228.           break;
  229.           case 14:
  230.            $text = "item";
  231.            $item2 = Item::get(49,0,128);
  232.            $name = "64 obby x2";
  233.            $this->spawnItem($block, $item2, $player);
  234.            $this->spawnOpenChest($player, $block);
  235.            $this->spawnNamedText($block, $player, $text);
  236.            $this->spawnNamedChest($block, $player, $name);
  237.            $this->setAllowed($player, false);
  238.            $player->sendMessage(C::GREEN . "You Opened A §6Rare Crate!");
  239.            $player->getInventory()->addItem($item2);
  240.            $this->getServer()->getScheduler()->scheduleDelayedTask(new CloseChest($this, $player, $block), 60 * 3);
  241.            $this->getServer()->getScheduler()->scheduleDelayedTask(new CoolDown($this, $player), 10 * 20);
  242.           break;
  243.           case 15:
  244.            $text = "item";
  245.            $item2 = Item::get(46,0,30);
  246.            $name = "30 tnt";
  247.            $this->spawnItem($block, $item2, $player);
  248.            $this->spawnOpenChest($player, $block);
  249.            $this->spawnNamedText($block, $player, $text);
  250.            $this->spawnNamedChest($block, $player, $name);
  251.            $this->setAllowed($player, false);
  252.            $player->sendMessage(C::GREEN . "You Opened A §6Rare Crate!");
  253.            $player->getInventory()->addItem($item2);
  254.            $this->getServer()->getScheduler()->scheduleDelayedTask(new CloseChest($this, $player, $block), 60 * 3);
  255.            $this->getServer()->getScheduler()->scheduleDelayedTask(new CoolDown($this, $player), 10 * 20);
  256.           break;
  257.           case 16:
  258.            $text = "item";
  259.            $item2 = Item::get(46,0,30);
  260.            $name = "40 tnt";
  261.            $this->spawnItem($block, $item2, $player);
  262.            $this->spawnOpenChest($player, $block);
  263.            $this->spawnNamedText($block, $player, $text);
  264.            $this->spawnNamedChest($block, $player, $name);
  265.            $this->setAllowed($player, false);
  266.            $player->sendMessage(C::GREEN . "You Opened A §6Rare Crate!");
  267.            $player->getInventory()->addItem($item2);
  268.            $this->getServer()->getScheduler()->scheduleDelayedTask(new CloseChest($this, $player, $block), 60 * 3);
  269.            $this->getServer()->getScheduler()->scheduleDelayedTask(new CoolDown($this, $player), 10 * 20);
  270.           break;
  271.           case 17:
  272.            $text = "item";
  273.            $item2 = Item::get(131,0,2);
  274.            $name = "2 uncommon";
  275.            $item->setCustomName("§bUncommon Key");
  276.            $this->spawnItem($block, $item2, $player);
  277.            $this->spawnOpenChest($player, $block);
  278.            $this->spawnNamedText($block, $player, $text);
  279.            $this->spawnNamedChest($block, $player, $name);
  280.            $this->setAllowed($player, false);
  281.            $player->sendMessage(C::GREEN . "You Opened A §6Rare Crate!");
  282.            $player->getInventory()->addItem($item2);
  283.            $this->getServer()->getScheduler()->scheduleDelayedTask(new CloseChest($this, $player, $block), 60 * 3);
  284.            $this->getServer()->getScheduler()->scheduleDelayedTask(new CoolDown($this, $player), 10 * 20);
  285.           break;
  286.           case 18:
  287.            $text = "item";
  288.            $item2 = Item::get(131,0,3);
  289.            $name = "3 uncommon";
  290.            $item->setCustomName("§bUncommon Key");
  291.            $this->spawnItem($block, $item2, $player);
  292.            $this->spawnOpenChest($player, $block);
  293.            $this->spawnNamedText($block, $player, $text);
  294.            $this->spawnNamedChest($block, $player, $name);
  295.            $this->setAllowed($player, false);
  296.            $player->sendMessage(C::GREEN . "You Opened A §6Rare Crate!");
  297.            $player->getInventory()->addItem($item2);
  298.            $this->getServer()->getScheduler()->scheduleDelayedTask(new CloseChest($this, $player, $block), 60 * 3);
  299.            $this->getServer()->getScheduler()->scheduleDelayedTask(new CoolDown($this, $player), 10 * 20);
  300.           break;
  301.           }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement