Solved Teleport on block

Discussion in 'Plugin Development' started by EDSEL, Aug 21, 2019.

Thread Status:
Not open for further replies.
  1. Offline

    EDSEL

    What should I do so that I can teleport to "block 1"

    This is my code:

    Code:
        @EventHandler
        public void onPlayerClickomItem(InventoryClickEvent e) {
            Player p = (Player) e.getWhoClicked();
            Block block1 = p.getWorld().getBlockAt(123, 105, -118);
            if (e.getRawSlot() == e.getSlot() && e.getInventory().getTitle().equals("gui")) {
                switch (e.getSlot()) {
                case 0:
                    e.getWhoClicked().closeInventory();
                    p.teleport((Location) block1);
                    break;
     
  2. Offline

    timtower Administrator Administrator Moderator

    @EDSEL block1.getLocation() ?
     
    EDSEL likes this.
  3. Offline

    EDSEL

    XD thank you
     
Thread Status:
Not open for further replies.

Share This Page