diff --git a/plugin/src/main/java/net/aufdemrand/denizen/objects/dLocation.java b/plugin/src/main/java/net/aufdemrand/denizen/objects/dLocation.java index 93ac64dc78..7136c024a7 100644 --- a/plugin/src/main/java/net/aufdemrand/denizen/objects/dLocation.java +++ b/plugin/src/main/java/net/aufdemrand/denizen/objects/dLocation.java @@ -727,19 +727,26 @@ else if (type == Material.TRAP_DOOR } // <--[tag] - // @attribute + // @attribute // @returns Element // @mechanism dLocation.skull_skin // @description - // Returns the skin the skull item is displaying - just the name or UUID as text, not a player object. + // Returns the name of the skin the skull item is displaying. // --> + if (attribute.startsWith("skull_name")) { + BlockState blockState = getBlock().getState(); + if (blockState instanceof Skull) { + PlayerProfile profile = NMSHandler.getInstance().getBlockHelper().getPlayerProfile((Skull) blockState); + return new Element(profile.getName()).getAttribute(attribute); + } + } + // <--[tag] - // @attribute - // @returns Element|Element + // @attribute + // @returns Element // @mechanism dLocation.skull_skin // @description - // Returns the skin the skull item is displaying - just the name or UUID as text, not a player object, - // along with the permanently cached texture property. + // Returns the skin the skull item is displaying - just the name or UUID as text, not a player object. // --> if (attribute.startsWith("skull_skin")) { BlockState blockState = getBlock().getState(); @@ -749,6 +756,14 @@ else if (type == Material.TRAP_DOOR UUID uuid = profile.getUniqueId(); String texture = profile.getTexture(); attribute = attribute.fulfill(1); + // <--[tag] + // @attribute + // @returns Element|Element + // @mechanism dLocation.skull_skin + // @description + // Returns the skin the skull item is displaying - just the name or UUID as text, not a player object, + // along with the permanently cached texture property. + // --> if (attribute.startsWith("full")) { return new Element((uuid != null ? uuid : name != null ? name : null) + (texture != null ? "|" + texture : ""))