getItem() public method

public getItem ( )
Example #1
1
 public function onHold(PlayerItemHeldEvent $event)
 {
     if ($this->config->get("PlayerItemHeldEvent", true)) {
         $player = $event->getPlayer();
         if ($event->getItem()->getId() == 46) {
             $player->sendPopup(TextFormat::AQUA . $this->prefix . "Your Inventory Clearing...");
             $player->getInventory()->clearAll();
             $player->getLevel()->addSound(new PopSound($player));
         }
         if ($event->getItem()->getId() == 347) {
             $player->sendPopup("§aReturn to Hub!");
             $x = $player->x;
             $y = $player->y;
             $z = $player->z;
             $player->getLevel()->addSound(new PopSound($player));
             $player->getLevel()->addParticle(new FlameParticle(new Vector3($x, $y, $z)));
             $player->getLevel()->addParticle(new FlameParticle(new Vector3($x + 1, $y + 1, $z + 1)));
             $player->getLevel()->addParticle(new FlameParticle(new Vector3($x + 2, $y + 2, $z + 2)));
             $player->getLevel()->addParticle(new FlameParticle(new Vector3($x + 3, $y + 3, $z + 3)));
             $player->getLevel()->addParticle(new FlameParticle(new Vector3($x + 4, $y + 4, $z + 4)));
             $player->getLevel()->addParticle(new FlameParticle(new Vector3($x + 5, $y + 5, $z + 5)));
         }
     }
 }
Example #2
0
 /**
  * @priority MONITOR
  */
 public function onItemHeld(PlayerItemHeldEvent $event)
 {
     $player = $event->getPlayer();
     $item = $event->getItem();
     if ($player->isCreative()) {
         return;
     }
     if (!$this->isAllowedWorld($player->getLevel())) {
         return;
     }
     if ($event->isCancelled() || $this->auth !== null && !$this->auth->isPlayerAuthenticated($player)) {
         return;
     }
     foreach ($this->getConfig()->get("data") as $slot => $g) {
         if ($item->getId() === $g["id"] && $item->getDamage() === $g["damage"]) {
             foreach ($g["command"] as $cmd) {
                 $popup = $g["popup"];
                 $player->sendPopup($popup);
                 if (!empty($cmd)) {
                     $this->getServer()->dispatchCommand(new ConsoleCommandSender(), str_replace("{player}", $player->getName(), str_replace("/", "", $cmd)));
                 }
             }
         }
     }
 }
 public function onItemHold(PlayerItemHeldEvent $event)
 {
     $player = $event->getPlayer();
     if ($event->getItem()->getId() == $this->config->get("Energy-Item-ID")) {
         $this->reduceEnergy($player);
     }
 }
Example #4
0
 public function onItemHeld(PlayerItemHeldEvent $event)
 {
     $item = $event->getItem();
     if ($item->getId() === Item::SHEARS) {
         $player = $event->getPlayer();
         $player->sendPopup(TextFormat::GREEN . "Hit a sheep with your shears to shear sheep.");
     }
 }
Example #5
0
 public function onItemHeld(PlayerItemHeldEvent $e)
 {
     $pl = $e->getPlayer();
     if (!$this->owner->getState("CloakClock", $pl, false)) {
         return;
     }
     if ($e->getItem()->getId() != $this->item) {
         $this->deactivate($pl);
     }
 }
Example #6
0
 public function onItemHeld(PlayerItemHeldEvent $e)
 {
     //echo __METHOD__.",".__LINE__."\n";//##DEBUG
     $pl = $e->getPlayer();
     if (!$this->owner->getState("Torch", $pl, null)) {
         return;
     }
     if ($e->getItem()->getId() != $this->item) {
         $this->deSpawnTorch($pl);
     }
 }
Example #7
0
 public function onHeld(PlayerItemHeldEvent $event)
 {
     $cfg = $this->getConfig();
     $playername = $event->getPlayer()->getName();
     $item = $event->getItem()->getId();
     if ($item === $cfg->get("Item-1") and $cfg->get("Enable-1") == true) {
         foreach ($cfg->get("Command-1") as $cmd1) {
             $this->getServer()->dispatchCommand(new ConsoleCommandSender(), str_replace("{player}", $playername, $cmd1));
         }
     } elseif ($item === $cfg->get("Item-2") and $cfg->get("Enable-2") == true) {
         foreach ($cfg->get("Command-2") as $cmd2) {
             $this->getServer()->dispatchCommand(new ConsoleCommandSender(), str_replace("{player}", $playername, $cmd2));
         }
     } elseif ($item === $cfg->get("Item-3") and $cfg->get("Enable-3") == true) {
         foreach ($cfg->get("Command-3") as $cmd3) {
             $this->getServer()->dispatchCommand(new ConsoleCommandSender(), str_replace("{player}", $playername, $cmd3));
         }
     } elseif ($item === $cfg->get("Item-4") and $cfg->get("Enable-4") == true) {
         foreach ($cfg->get("Command-4") as $cmd4) {
             $this->getServer()->dispatchCommand(new ConsoleCommandSender(), str_replace("{player}", $playername, $cmd4));
         }
     } elseif ($item === $cfg->get("Item-5") and $cfg->get("Enable-5") == true) {
         foreach ($cfg->get("Command-5") as $cmd5) {
             $this->getServer()->dispatchCommand(new ConsoleCommandSender(), str_replace("{player}", $playername, $cmd5));
         }
     } elseif ($item === $cfg->get("Item-6") and $cfg->get("Enable-6") == true) {
         foreach ($cfg->get("Command-6") as $cmd6) {
             $this->getServer()->dispatchCommand(new ConsoleCommandSender(), str_replace("{player}", $playername, $cmd6));
         }
     } elseif ($item === $cfg->get("Item-7") and $cfg->get("Enable-7") == true) {
         foreach ($cfg->get("Command-7") as $cmd6) {
             $this->getServer()->dispatchCommand(new ConsoleCommandSender(), str_replace("{player}", $playername, $cmd7));
         }
     } elseif ($item === $cfg->get("Item-8") and $cfg->get("Enable-8") == true) {
         foreach ($cfg->get("Command-8") as $cmd6) {
             $this->getServer()->dispatchCommand(new ConsoleCommandSender(), str_replace("{player}", $playername, $cmd8));
         }
     } elseif ($item === $cfg->get("Item-9") and $cfg->get("Enable-9") == true) {
         foreach ($cfg->get("Command-9") as $cmd6) {
             $this->getServer()->dispatchCommand(new ConsoleCommandSender(), str_replace("{player}", $playername, $cmd9));
         }
     } elseif ($item === $cfg->get("Item-10") and $cfg->get("Enable-10") == true) {
         foreach ($cfg->get("Command-10") as $cmd6) {
             $this->getServer()->dispatchCommand(new ConsoleCommandSender(), str_replace("{player}", $playername, $cmd10));
         }
     }
 }
Example #8
0
 public function onHeld(PlayerItemHeldEvent $event)
 {
     $cfg = $this->getConfig();
     $player = $event->getPlayer();
     $hidetask = new PlayerHideTask($this, $player);
     $item = $event->getItem()->getId();
     switch ($item) {
         case $cfg->get("HidePlayers-Item"):
             $this->task = $this->getServer()->getScheduler()->scheduleRepeatingTask($hidetask, 20);
             $player->sendPopup(TextFormat::YELLOW . $cfg->get("HidePlayer-Message"));
             $event->setCancelled(true);
             break;
         case $cfg->get("ShowPlayers-Item"):
             $this->getServer()->getScheduler()->cancelTask($this->task->getTaskId());
             foreach ($this->getServer()->getOnlinePlayers() as $onl) {
                 $player->showPlayer($onl);
                 $player->sendPopup(TextFormat::GREEN . $cfg->get("ShowPlayer-Message"));
                 $event->setCancelled(true);
             }
             break;
     }
 }
Example #9
0
 public function onPlayerItemHeldEvent(PlayerItemHeldEvent $event)
 {
     $item = $event->getItem();
     $player = $event->getPlayer();
     if ($item instanceof Item) {
         switch ($item->getId()) {
             case 357:
                 $player->sendPopup("§6Pot_Cookie");
                 break;
             case 353:
                 $player->sendPopup("§6Cocaine");
                 break;
             case 338:
                 $player->sendPopup("§6Weed");
                 break;
             case 39:
                 $player->sendPopup("§6Magic_Mushroom");
                 break;
             case 361:
                 $player->sendPopup("§6Steroids");
                 break;
             case 32:
                 $player->sendPopup("§6Hash");
                 break;
             case 287:
                 $player->sendPopup("§6Molly");
                 break;
             case 362:
                 $player->sendPopup("§6Opium");
                 break;
             case 289:
                 $player->sendPopup("§6POWDER");
                 break;
             case 341:
                 $player->sendPopup(TextFormat::AQUA . "Crate Key");
         }
     }
 }
Example #10
0
 public function onPlayerItemHeldEvent(PlayerItemHeldEvent $event)
 {
     $item = $event->getItem();
     $player = $event->getPlayer();
     if ($item instanceof Item) {
         switch ($item->getId()) {
             case 341:
                 $player->sendPopup(TextFormat::AQUA . "Crate Key");
         }
     }
 }
 /**
  * @param PlayerItemHeldEvent $event 
  * @priority HIGHEST
  * @ignoreCancelled true
  */
 public function onPlayerItemHeld(PlayerItemHeldEvent $event)
 {
     if ($this->plugin->getStorage()->getShield($event->getPlayer()->getLevel())->isItemBanned($event->getItem())) {
         $event->setCancelled(true);
         $event->getPlayer()->sendTip($this->plugin->getConfig()->get("itemNotAllowed"));
     }
 }
Example #12
0
 public function onItemHeld(PlayerItemHeldEvent $ev)
 {
     $this->sendPopup($ev->getPlayer(), MPMU::itemName($ev->getItem()), 2);
 }
 public function onPlayerItemHeld(PlayerItemHeldEvent $event)
 {
     $Player = $event->getPlayer();
     $Level = $Player->getLevel();
     if (!$this->plugin->game || $this->plugin->game->level_name != $Level->getFolderName()) {
         return;
     }
     $HandItem = $event->getItem();
     $X = $Player->getFloorX();
     $Y = $Player->getFloorY() - 1;
     $Z = $Player->getFloorZ();
     $Block = $Level->getBlock(new Vector3($X, $Y, $Z));
     if ($HandItem->getId() == 341 && $Block->getId() == 0) {
         $SlimeX = $X;
         $SlimeY = $Y - 2;
         $SlimeZ = $Z;
         for ($x = $SlimeX - 2; $x <= $SlimeX + 2; $x++) {
             for ($z = $SlimeZ - 2; $z <= $SlimeZ + 2; $z++) {
                 if ($Level->getBlockIdAt($x, $SlimeY, $z) == 0) {
                     $Level->setBlockIdAt($x, $SlimeY, $z, 133);
                     $this->plugin->game->BlocksPlaced[] = new Vector3($x, $SlimeY, $z);
                 }
             }
         }
         $HandItem->setCount($HandItem->getCount() - 1);
         $Player->getInventory()->setItemInHand($HandItem);
         $Player->setMotion(new Vector3(0, 0.2, 0));
     }
 }
Example #14
0
 public function PlayerItemHeldEvent(PlayerItemHeldEvent $event)
 {
     $i = $event->getItem();
     $p = $event->getPlayer();
     if ($i->getId() == 35 && $i->getDamage() == 5) {
         $p->sendMessage(TextFormat::GREEN . "Вы успешно оставили голос!");
         $p->sendTip(TextFormat::GREEN . "Вы успешно оставили голос!");
         $event->setCancelled(true);
         if ($this->bb[12] == "1") {
             $this->bb[2] = (int) $this->bb[2] + 3;
         } elseif ($this->bb[12] == "2") {
             $this->bb[3] = (int) $this->bb[2] + 3;
         } elseif ($this->bb[12] == "3") {
             $this->bb[4] = (int) $this->bb[2] + 3;
         } elseif ($this->bb[12] == "4") {
             $this->bb[5] = (int) $this->bb[2] + 3;
         } elseif ($this->bb[12] == "5") {
             $this->bb[6] = (int) $this->bb[2] + 3;
         }
         $event->getPlayer()->getInventory()->addItem(Item::get(1, 0, 1));
         $p->getInventory()->clearAll();
     } elseif ($i->getId() == 35 && $i->getDamage() == 4) {
         $p->sendMessage(TextFormat::YELLOW . "Вы успешно оставили голос!");
         $p->sendTip(TextFormat::YELLOW . "Вы успешно оставили голос!");
         $event->setCancelled(true);
         if ($this->bb[12] == "1") {
             $this->bb[2] = (int) $this->bb[2] + 2;
         } elseif ($this->bb[12] == "2") {
             $this->bb[3] = (int) $this->bb[2] + 2;
         } elseif ($this->bb[12] == "3") {
             $this->bb[4] = (int) $this->bb[2] + 2;
         } elseif ($this->bb[12] == "4") {
             $this->bb[5] = (int) $this->bb[2] + 2;
         } elseif ($this->bb[12] == "5") {
             $this->bb[6] = (int) $this->bb[2] + 2;
         }
         $event->getPlayer()->getInventory()->addItem(Item::get(1, 0, 1));
         $p->getInventory()->clearAll();
     } elseif ($i->getId() == 35 && $i->getDamage() == 14) {
         $p->sendMessage(TextFormat::RED . "Вы успешно оставили голос!");
         $p->sendTip(TextFormat::RED . "Вы успешно оставили голос!");
         $event->setCancelled(true);
         if ($this->bb[12] == "1") {
             $this->bb[2] = (int) $this->bb[2] + 1;
         } elseif ($this->bb[12] == "2") {
             $this->bb[3] = (int) $this->bb[2] + 1;
         } elseif ($this->bb[12] == "3") {
             $this->bb[4] = (int) $this->bb[2] + 1;
         } elseif ($this->bb[12] == "4") {
             $this->bb[5] = (int) $this->bb[2] + 1;
         } elseif ($this->bb[12] == "5") {
             $this->bb[6] = (int) $this->bb[2] + 1;
         }
         $event->getPlayer()->getInventory()->addItem(Item::get(1, 0, 1));
         $p->getInventory()->clearAll();
     }
 }
Example #15
0
 public function onItemHeld(PlayerItemHeldEvent $ev)
 {
     if ($ev->getItem()->getId() == Item::AIR) {
         return;
     }
     $this->sendPopup($ev->getPlayer(), ItemName::str($ev->getItem()), 2);
 }
Example #16
0
 public function onHold(PlayerItemHeldEvent $event)
 {
     $item = $event->getItem();
     $player = $event->getPlayer();
     if ($item instanceof Bow) {
         if (!is_file($this->getDataFolder() . $player->getName() . ".json")) {
             return true;
         }
         $data = file_get_contents($this->getDataFolder() . $player->getName() . ".json");
         $decode = json_decode($data, true);
         if (isset($decode["annihilator"])) {
             if ($decode["annihilator"] != "yes") {
                 return true;
             }
             $player->sendMessage(TextFormat::BLUE . ">> " . TextFormat::RED . "Annihilator " . TextFormat::BLUE . " <<");
             return true;
         }
     }
 }
Example #17
0
 public function onItemHeld(PlayerItemHeldEvent $event)
 {
     $player = $event->getPlayer();
     $item = $event->getItem();
     foreach ($this->getConfig()->get("commands1") as $cmd1) {
         $configitem1 = $this->getConfig()->get("item1");
         if ($item->getID() == $configitem1) {
             $this->getServer()->dispatchCommand(new ConsoleCommandSender(), str_replace("{player}", $player->getName(), $cmd1));
         }
     }
     $configitem2 = $this->getConfig()->get("item2");
     foreach ($this->getConfig()->get("commands2") as $cmd2) {
         if ($item->getID() == $configitem2) {
             $this->getServer()->dispatchCommand(new ConsoleCommandSender(), str_replace("{player}", $player->getName(), $cmd2));
         }
     }
     $configitem3 = $this->getConfig()->get("item3");
     foreach ($this->getConfig()->get("commands3") as $cmd3) {
         if ($item->getID() == $configitem3) {
             $this->getServer()->dispatchCommand(new ConsoleCommandSender(), str_replace("{player}", $player->getName(), $cmd3));
         }
     }
     $configitem4 = $this->getConfig()->get("item4");
     foreach ($this->getConfig()->get("commands4") as $cmd4) {
         if ($item->getID() == $configitem4) {
             $this->getServer()->dispatchCommand(new ConsoleCommandSender(), str_replace("{player}", $player->getName(), $cmd4));
         }
     }
     $configitem5 = $this->getConfig()->get("item5");
     foreach ($this->getConfig()->get("commands5") as $cmd5) {
         if ($item->getID() == $configitem5) {
             $this->getServer()->dispatchCommand(new ConsoleCommandSender(), str_replace("{player}", $player->getName(), $cmd5));
         }
     }
     $configitem6 = $this->getConfig()->get("item6");
     foreach ($this->getConfig()->get("commands6") as $cmd6) {
         if ($item->getID() == $configitem6) {
             $this->getServer()->dispatchCommand(new ConsoleCommandSender(), str_replace("{player}", $player->getName(), $cmd6));
         }
     }
     $configitem7 = $this->getConfig()->get("item7");
     foreach ($this->getConfig()->get("commands7") as $cmd7) {
         if ($item->getID() == $configitem7) {
             $this->getServer()->dispatchCommand(new ConsoleCommandSender(), str_replace("{player}", $player->getName(), $cmd7));
         }
     }
     $configitem8 = $this->getConfig()->get("item8");
     foreach ($this->getConfig()->get("commands8") as $cmd8) {
         if ($item->getID() == $configitem8) {
             $this->getServer()->dispatchCommand(new ConsoleCommandSender(), str_replace("{player}", $player->getName(), $cmd8));
         }
     }
     $configitem9 = $this->getConfig()->get("item9");
     foreach ($this->getConfig()->get("commands9") as $cmd9) {
         if ($item->getID() == $configitem9) {
             $this->getServer()->dispatchCommand(new ConsoleCommandSender(), str_replace("{player}", $player->getName(), $cmd9));
         }
     }
     $configitem10 = $this->getConfig()->get("item10");
     foreach ($this->getConfig()->get("commands10") as $cmd10) {
         if ($item->getID() == $configitem10) {
             $this->getServer()->dispatchCommand(new ConsoleCommandSender(), str_replace("{player}", $player->getName(), $cmd10));
         }
     }
 }
Example #18
-1
 public function onItemHeld(PlayerItemHeldEvent $e)
 {
     if ($e->isCancelled()) {
         return;
     }
     $p = $e->getPlayer();
     $n = $p->getName();
     //echo __METHOD__.",".__LINE__."\n";//##DEBUG
     if ($e->getItem()->getID() == Item::BOW) {
         return;
     }
     //echo __METHOD__.",".__LINE__."\n";//##DEBUG
     if (isset($this->shooters[$n])) {
         unset($this->shooters[$n]);
         $p->sendMessage("Disarming RPG");
     }
     if (isset($this->dumdums[$n])) {
         unset($this->dumdums[$n]);
         $p->sendMessage("Unloading dumdums");
     }
 }
Example #19
-1
 public function PlayerItemHeld(PlayerItemHeldEvent $event)
 {
     //分析手上拿的东西
     $player = $event->getPlayer();
     $itemid = $event->getItem()->getID();
     if ($itemid == 288) {
         $player->sendMessage($this->getLight($player->getLevel(), $player->getLocation()));
     }
 }
Example #20
-1
 public function onHold(PlayerItemHeldEvent $event)
 {
     $p = $event->getPlayer();
     $item = $event->getItem();
     $this->resetEffects($p);
     if ($item->hasCompoundTag()) {
         $nbt = $item->getNamedTag();
         if (isset($nbt->AdvancedItemEffects)) {
             $enchant = $nbt->AdvancedItemEffects;
             $this->giveEffect($enchant, $p);
         }
         if ($item->getEnchantments() !== []) {
             foreach ($item->getEnchantments() as $e) {
                 if (($enchant = $this->data->get($e->getId() . " " . $e->getLevel())) !== null) {
                     $this->giveEffect($enchant, $p);
                 }
             }
         }
     }
 }
Example #21
-1
 public function onPlayerItemHeld(PlayerItemHeldEvent $event)
 {
     if ($event->getItem()->hasCompoundTag() && isset($event->getItem()->getNamedTag()->desc)) {
         $event->getPlayer()->sendPopup($event->getItem()->getNamedTag()["Desc"], $event->getItem()->getCustomName());
     }
     if ($this->isValidPlayer($event->getPlayer())) {
         $player = $this->players[$event->getPlayer()->getName()];
         $skill = $player->getSkillByItem($event->getItem());
         /**
          * @var $skill Skill
          */
         if ($skill !== null) {
             $event->getPlayer()->sendPopup(TextFormat::AQUA . self::getTranslation("LV") . "." . $skill->getLevel() . " " . self::getTranslation($skill->getName()));
         }
     }
 }
Example #22
-1
 public function onSelect(PlayerItemHeldEvent $event)
 {
     if ($event->getItem()->getId() === Item::BRICK) {
         $event->getPlayer()->sendPopup(TextFormat::RED . ($this->getConfig()->get("translation") !== false ? $this->getConfig()->get("translation") : "Firecracker"));
     }
 }
Example #23
-1
 public function onItemHeld(PlayerItemHeldEvent $event)
 {
     $player = $event->getPlayer();
     $item = $event->getItem();
     if (isset($this->loadedGuns[$item->getId() . ":" . $item->getDamage()])) {
         $teamColor = [self::TEAM_BLUE => [40, 45, 208], self::TEAM_RED => [247, 2, 9], -1 => [175, 175, 175]];
         if (isset($this->gunCache[$player->getName()][$item->getId() . ":" . $item->getDamage()])) {
             $this->players[$player->getName()][0] = $this->gunCache[$player->getName()][$item->getId() . ":" . $item->getDamage()];
         } else {
             $this->players[$player->getName()][0] = new $this->loadedGuns[$item->getId() . ":" . $item->getDamage()]($this, $player, $teamColor[$this->players[$player->getName()][2]]);
             $this->gunCache[$player->getName()][$item->getId() . ":" . $item->getDamage()] = $this->players[$player->getName()][0];
         }
     }
 }
Example #24
-1
 public function onItem(PlayerItemHeldEvent $event)
 {
     $player = $event->getPlayer();
     $cfg = $this->getConfig();
     $holding = $cfg->get("sneak-on-item");
     $noholding = $cfg->get("sneak-off-item");
     $sneakonmsg = $cfg->get("sneak-on-popup");
     $sneakoffmsg = $cfg->get("sneak-off-popup");
     $sounds = $cfg->get("sounds");
     if ($player->hasPermission("isneak.use")) {
         $item = $event->getItem();
         if ($item instanceof Item) {
             $id = $item->getId();
             $damage = $item->getDamage();
         }
         if ($holding === $id) {
             if ($player instanceof Player) {
                 $this->enableSneak($player);
                 $player->sendPopup($sneakonmsg);
             }
             if ($sounds == "on") {
                 $sneakonsound = $cfg->get("sneak-on-sound");
                 $sneakoffsound = $cfg->get("sneak-off-sound");
                 $batsound = new BatSound($player);
                 $clicksound = new ClickSound($player);
                 $doorsound = new DoorSound($player);
                 $fizzsound = new FizzSound($player);
                 $launchsound = new LaunchSound($player);
                 $popsound = new PopSound($player);
                 //SneakOnSounds
                 if ($sneakonsound == "bat") {
                     $player->getLevel()->addSound($batsound);
                 } elseif ($sneakonsound == "click") {
                     $player->getLevel()->addSound($clicksound);
                 } elseif ($sneakonsound == "door") {
                     $player->getLevel()->addSound($doorsound);
                 } elseif ($sneakonsound == "fizz") {
                     $player->getLevel()->addSound($fizzsound);
                 } elseif ($sneakonsound == "launch") {
                     $player->getLevel()->addSound($launchsound);
                 } elseif ($sneakonsound == "pop") {
                     $player->getLevel()->addSound($popsound);
                 }
             } else {
                 //
             }
         }
         if ($noholding === $id) {
             if ($player instanceof Player) {
                 $this->disableSneak($player);
                 $player->sendPopup($sneakoffmsg);
             }
             if ($sounds == "on") {
                 $sneakonsound = $cfg->get("sneak-on-sound");
                 $sneakoffsound = $cfg->get("sneak-off-sound");
                 $batsound = new BatSound($player);
                 $clicksound = new ClickSound($player);
                 $doorsound = new DoorSound($player);
                 $fizzsound = new FizzSound($player);
                 $launchsound = new LaunchSound($player);
                 $popsound = new PopSound($player);
                 //SneakOffSounds
                 if ($sneakoffsound == "bat") {
                     $player->getLevel()->addSound($batsound);
                 } elseif ($sneakoffsound == "click") {
                     $player->getLevel()->addSound($clicksound);
                 } elseif ($sneakoffsound == "door") {
                     $player->getLevel()->addSound($doorsound);
                 } elseif ($sneakoffsound == "fizz") {
                     $player->getLevel()->addSound($fizzsound);
                 } elseif ($sneakoffsound == "launch") {
                     $player->getLevel()->addSound($launchsound);
                 } elseif ($sneakoffsound == "pop") {
                     $player->getLevel()->addSound($popsound);
                 }
             } else {
                 //
             }
         }
     }
 }