Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function registerItems(): void{
- libItemRegistrar::getInstance()->registerItem(new class(new ItemIdentifier(ItemTypeIds::FISHING_ROD), "Fishing Rod") extends FishingRod {
- public function onClickAir(Player $player, Vector3 $directionVector) : ItemUseResult{
- if (!$player->hasItemCooldown($this)) {
- $player->resetItemCooldown($this);
- if (Core::getFishingHook($player) === NULL) {
- $hook = new Hook($player->getLocation(), $player, new CompoundTag());
- $hook->spawnToAll();
- } else {
- if ($this != null && !$this->isNull()) {
- $hook = Core::getFishingHook($player);
- $hook->delete();
- }
- Core::setFishingHook(NULL, $player);
- }
- $player->broadcastAnimation(new ArmSwingAnimation($player));
- return ItemUseResult::SUCCESS();
- }
- return ItemUseResult::FAIL();
- }
- }, libItemRegistrar::getInstance()->getRuntimeIdByName(VanillaItems::FISHING_ROD()->getVanillaName()), true);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement