Giving block a hover-name

Discussion in 'Spigot Plugin Development' started by sander_blaadjes, Jun 18, 2016.

  1. Hello, I was recently doing some tests and I was trying to give blocks a name, like you can do with animals. (Which would only show up when you look at it, not like with an ArmorStand)

    However, after quite a lot of searching, I was not able to find a way to do this. Is there someone that could guide me into the correct direction to figuring this out?
  2. Use Hologram's API.
  3. I'm not too sure about this, but one idea could be to -

    [1] Check if the player is looking at the block
    [2] Spawn an armor stand inside/under the block so the armor stands name would be right above the block
    [3] When they move away, remove the armor stand

    This is just a suggestions idrk if/how it would work
  4. I think that block might technically be an entity. The functionality you're looking for is achieved on entities with a tag.
  5. Spawning an armorstand would show it to all players. I also don't feel like checking if a player is looking at a block if there is already something built-into Minecraft...
  6. getTargetBlock, check if it matches your block, spawn invisible armorstand through packets and profit.
    • Agree Agree x 2
  7. I would have used this if there wasn't something built-into MC already. I don't feel like using server resources for something like this, if it is something which is available in MC already.
  8. There won't be anything in Bukkit/Spigot for this, there may be something in the NMS but not sure if this is handled client side with the structure blocks.
  9. MiniDigger


    I did not look at the code for the structure block yet but I don't think that that api is anywhere near useable from server side.
    the solution teddy suggested should work without consuming too much resources.
  10. Maybe a falling block? Not sure if the client can render a custom name though.

    Edit:Just make sure the falling block doesn't actually fall
  11. or, you know, you could make a mob with no movement, put it (in) the block(haven't tested this, so it might not work, and make sure it does not die, like, ever. and then make a block destruction event to check when that block is destroyed, it will destroy the entity as well?

    im going crazy >>
    • Agree Agree x 1
    • Creative Creative x 1