Following problem, I'm trying to give an item to a player with a special name. The item is given to the player, but the name is not changed:
public void givePlayerItem (ItemStack item, Player p, String name) {
ItemMeta itemMeta = item.getItemMeta ();
itemMeta.setDisplayName (name);
item.setItemMeta (itemMeta);
p.getInventory (). AddItem (item);
}
Maybe you see a mistake
Maybe execute method
Yes, of course I did Sherlock xD,
I also get the item but the name is not changed.
You have to do a nbt
What is 'an nbt' ^^
If item metadata, inform yourself
Do I have it?
Did you write the name of the item in ""?
And where does it stand which item it is?
It was a chest
Yes, there was a name. I tried the same thing in a Listner and it works perfectly,
I will then continue in the Listner hm thanks for the help