HeadDatabase-API icon indicating copy to clipboard operation
HeadDatabase-API copied to clipboard

Error when calling .getBlockID(org.bukkit.block.Block block)

Open markus6890 opened this issue 3 months ago • 1 comments

Bug Report Template:

Required Information section:

ALL FIELDS IN THIS SECTION ARE REQUIRED, and must contain appropriate information

HeadDatabase version:

HeadDatabase version 4.21.2
Author: Arcaniax

Server build info:

This server is running Paper version 1.21.8-35-main@b200237 (2025-08-15T21:04:16Z) (Implementing API version 1.21.8-R0.1-SNAPSHOT)
You are 1 version(s) behind
Download the new version at: https://papermc.io/downloads/paper

Description of the problem:

i try to call .getBlockID(org.bukkit.block.Block block) from the HeadDatabaseAPI in one of my plugins when that line get ran it throws an java.lang.NoSuchMethodError: 'java.lang.String me.arcaniax.hdb.api.HeadDatabaseAPI.getBlockID(org.bukkit.block.Block)'

I get the same error in other plugins when i try to use .getBlockID on my server its not only in one of my plugins. everything else works fine with HDB other then it throws that error It also worked fine before i updated my server from 1.8 to 1.21.8

How to replicate:

try calling .getBlockID(org.bukkit.block.Block block) in a PlayerInteractEvent to check if a block is an HDB head

Additional Information:

the code: @EventHandler public void onHeadClick(PlayerInteractEvent event) { HeadDatabaseAPI api = new HeadDatabaseAPI(); if (event.getAction() != Action.RIGHT_CLICK_AIR && event.getAction() != Action.RIGHT_CLICK_BLOCK) { return; } if (event.getClickedBlock() == null) { return; }

    Block clickedblock = event.getClickedBlock();
    Player player = event.getPlayer();

    if(!(clickedblock.getType() == Material.PLAYER_HEAD || clickedblock.getType() == Material.PLAYER_WALL_HEAD)) {
        return;
    }

    if(api.getBlockID(clickedblock) == null) {  // Error here
        player.sendMessage("null");
        return;
    }
    player.sendMessage(api.getBlockID(clickedblock)); // Error here
}

markus6890 avatar Aug 17 '25 20:08 markus6890