Add get/set customName to Skull block (#12302)

This commit is contained in:
Shane Bee
2025-03-21 09:52:00 -07:00
committed by GitHub
parent 7cc6cb5013
commit f49d18df89
3 changed files with 36 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
package org.bukkit.block;
import net.kyori.adventure.text.Component;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.OfflinePlayer;
@@ -168,4 +169,24 @@ public interface Skull extends TileState {
@Deprecated(since = "1.13", forRemoval = true)
@Contract("_ -> fail")
public void setSkullType(SkullType skullType);
/**
* Get the custom name of skull.
* <p>This name is set when placing a skull item that has a custom name.
* This name is only carried back to the item when broken for player heads
* (skeleton/creeper heads will not retain the name).</p>
*
* @return Custom name of skull
*/
public @Nullable Component customName();
/**
* Set the custom name of skull.
* <p>This name is set when placing a skull item that has a custom name.
* This name is only carried back to the item when broken for player heads
* (skeleton/creeper heads will not retain the name).</p>
*
* @param customName Custom name of skull
*/
public void customName(@Nullable Component customName);
}