Skip to content
Advertisement

Getting an the name of an item and getting the string value returns gibberish

I want to get the player whos name matches the name of the block which was placed and updated this players gamemode to survival. But this just gives me gibberish in the console:

JavaScript
JavaScript

I tried doing ComponentLike etc but it returned null when I did that.

Advertisement

Answer

As per the comments you’re trying to get h the name of the player.

Refer https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/Player.html#getName() from the documentation.

First get the Player object and then fetch the name from the player object.

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement