接口 Skull
- 所有超级接口:
BlockState
,Metadatable
,PersistentDataHolder
,TileState
-
方法概要
修饰符和类型方法说明Gets the sound to play if the skull is placed on a note block.getOwner()
已过时。获取拥有此头颅的玩家的资料.获取拥有此头颅的玩家.已过时。请使用BlockData
已过时。请检查Material
类型boolean
hasOwner()
检测此头颅是否有主人.void
setNoteBlockSound
(@Nullable NamespacedKey noteBlockSound) Sets the sound to play if the skull is placed on a note block.boolean
void
setOwnerProfile
(@Nullable PlayerProfile profile) 设置拥有此头颅的玩家的资料.void
setOwningPlayer
(@NotNull OfflinePlayer player) 设置拥有此头颅的玩家.void
setRotation
(@NotNull BlockFace rotation) 已过时。请使用BlockData
void
setSkullType
(SkullType skullType) 已过时。请检查Material
类型从接口继承的方法 org.bukkit.block.BlockState
copy, copy, getBlock, getBlockData, getChunk, getData, getLightLevel, getLocation, getLocation, getRawData, getType, getWorld, getX, getY, getZ, isPlaced, setBlockData, setData, setRawData, setType, update, update, update
从接口继承的方法 org.bukkit.metadata.Metadatable
getMetadata, hasMetadata, removeMetadata, setMetadata
从接口继承的方法 org.bukkit.block.TileState
getPersistentDataContainer
-
方法详细资料
-
hasOwner
boolean hasOwner()检测此头颅是否有主人.原文: Checks to see if the skull has an owner
- 返回:
- true表示此头颅有主人
-
getOwner
已过时。请查阅getOwningPlayer()
.如果存在,获取这个头颅的主人.原文: Gets the owner of the skull, if one exists
- 返回:
- 头颅主人的名字,如果此头颅没有主人将返回null
-
setOwner
设置头颅的主人.根据提供的名称获取配置文件数据时涉及一个可能的阻塞式Web请求.
原文: Sets the owner of the skull
Involves a potentially blocking web request to acquire the profile data for the provided name.
- 参数:
name
- 新的头颅主人的名字- 返回:
- true表示成功设置这个头颅的主人
-
getOwningPlayer
获取拥有此头颅的玩家. 该头颅可能显示出玩家皮肤的头部, 这取决于头颅的类型.原文:Get the player which owns the skull. This player may appear as the texture depending on skull type.
- 返回:
- 头颅所有者
-
setOwningPlayer
设置拥有此头颅的玩家. 该头颅可能显示出玩家皮肤的头部, 这取决于头颅的类型.原文:Set the player which owns the skull. This player may appear as the texture depending on skull type.
- 参数:
player
- 头颅所有者
-
getOwnerProfile
获取拥有此头颅的玩家的资料. 此玩家资料所含的纹理取决于头颅类型.原文:Gets the profile of the player who owns the skull. This player profile may appear as the texture depending on skull type.
- 返回:
- 头颅所有者的资料
-
setOwnerProfile
设置拥有此头颅的玩家的资料. 此玩家资料所含的纹理取决于头颅类型.此资料必须包含唯一 id 和皮肤纹理. 如果两者都缺, 则资料必须包含玩家名, 服务器将利用玩家名来尝试查找其唯一 id 和皮肤纹理.
原文:Sets the profile of the player who owns the skull. This player profile may appear as the texture depending on skull type.
The profile must contain both a unique id and a skin texture. If either of these is missing, the profile must contain a name by which the server will then attempt to look up the unique id and skin texture.
- 参数:
profile
- 头颅所有者的资料- 抛出:
IllegalArgumentException
- 如果资料没有包含必要信息
-
getNoteBlockSound
Gets the sound to play if the skull is placed on a note block.
Note: This only works for player heads. For other heads, seeInstrument
.- 返回:
- the key of the sound, or null
-
setNoteBlockSound
Sets the sound to play if the skull is placed on a note block.
Note: This only works for player heads. For other heads, seeInstrument
.- 参数:
noteBlockSound
- the key of the sound to be played, or null
-
getRotation
已过时。请使用BlockData
获取这个头颅在世界的角度 (或头颅的朝向如果这个头颅被挂在墙上).原文: Gets the rotation of the skull in the world (or facing direction if this is a wall mounted skull).
- 返回:
- 头颅的角度
-
setRotation
已过时。请使用BlockData
设置这个头颅在世界的角度 (或头颅的朝向如果这个头颅被挂在墙上).原文: Sets the rotation of the skull in the world (or facing direction if this is a wall mounted skull).
- 参数:
rotation
- 头颅的角度
-
getSkullType
已过时。请检查Material
类型获取头颅的类型.原文: Gets the type of skull
- 返回:
- 头颅的类型
-
setSkullType
已过时。请检查Material
类型设置头颅的类型.原文: Sets the type of skull
- 参数:
skullType
- 头颅的类型
-
getOwningPlayer()
.