Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-7813

Material#isInteractable() returning false on all interactable blocks.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • Windows 10 x64
      openjdk version "22.0.1" 2024-04-16
      OpenJDK Runtime Environment (build 22.0.1+8-16)
      OpenJDK 64-Bit Server VM (build 22.0.1+8-16, mixed mode, sharing)

    • CraftBukkit version 4251-Spigot-491f367-f672c35 (MC: 1.21) (Implementing API version 1.21-R0.1-SNAPSHOT)
    • Yes

      When using Material#isInteractable(), uninteractable and interactable blocks return the same value.

      I made a simple function to test this.

      @EventHandler
      public static void debug(PlayerInteractEvent e){
          Player player = e.getPlayer();
          player.sendMessage("Hand: " + e.getHand());
          Block block = e.getClickedBlock();
          player.sendMessage("Block: " + block);
          if (block == null)return;
          Material material = block.getType();
          player.sendMessage("Intractable: " + material.isInteractable());
          player.sendMessage("_");
      } 

      Right-Clicking on Buttons, Doors, Hatches, Chests, and Redstone Repeaters all returned False.
      Right-Clicking on a Grass Block also returned False, which is good.

        1. 2024-07-03_11.26.12.png
          2024-07-03_11.26.12.png
          243 kB
        2. 2024-07-03_11.26.24.png
          2024-07-03_11.26.24.png
          179 kB
        3. 2024-07-03_11.26.43.png
          2024-07-03_11.26.43.png
          164 kB
        4. 2024-07-03_11.26.59.png
          2024-07-03_11.26.59.png
          228 kB
        5. 2024-07-03_11.27.10-1.png
          2024-07-03_11.27.10-1.png
          409 kB

            Unassigned Unassigned
            Eclipsebre EclipseBre
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: