Skip to content

Expression for Skull Texture#8500

Open
AnOwlBe wants to merge 4 commits intoSkriptLang:dev/featurefrom
AnOwlBe:feature/ExprSkullTexture
Open

Expression for Skull Texture#8500
AnOwlBe wants to merge 4 commits intoSkriptLang:dev/featurefrom
AnOwlBe:feature/ExprSkullTexture

Conversation

@AnOwlBe
Copy link
Copy Markdown

@AnOwlBe AnOwlBe commented Mar 14, 2026

Problem

Skript doesn't have it and Skbee sort of has it
Its a very useful utility used by almost every server

Solution

Adds an expression to set/get/reset/delete the skull texture of a player head

eg set the head texture of {_i} to "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNGNhNDA3ZDNiZGI1ZDBkODAzYjViZmU1MWU4NmU5MWY4YTI5ZTg2NWZjNGNkMzYwMmVhZjA3N2EwYjg1ZGQ2NSJ9fX0="

or reset head texture of {_i}

Testing Completed

Compiled and tested on 1.21.11 with no other addons it appears to work fine

Supporting Information

From testing upon texturing a player head if the name is minecraft's default value for the name (eg OwlBe's Head) then it will rename it to " 's head" else if its named eg "&cTest" it won't be renamed

Completes: none
Related: #8448
AI assistance: Tiny bit for retrieving texture value of a player head

@AnOwlBe AnOwlBe requested a review from a team as a code owner March 14, 2026 02:42
@AnOwlBe AnOwlBe requested review from cheeezburga and erenkarakal and removed request for a team March 14, 2026 02:42
Comment on lines +36 to +37
}
@Override
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
@Override
}
@Override

Comment on lines +28 to +29
}
@Override
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
@Override
}
@Override

@Name("Skull Texture")
@Description("The skull texture for a player head.")
@Example("set the skull texture of {_i} to \"<base64>\"")
@Since("2.15")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@Since("2.15")
@Since("INSERT VERSION")


@Name("Skull Texture")
@Description("The skull texture for a player head.")
@Example("set the skull texture of {_i} to \"<base64>\"")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you use an example base64 string here so that its more clear here. should probably return notch's skull or someone else's

public void change(Event event, Object @Nullable [] delta, ChangeMode mode) {
String value = delta == null ? null : (String) delta[0];
switch (mode) {
case DELETE, RESET:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enhanced switch can be used

Comment on lines +65 to +67
@Nullable
@Override
public String convert(ItemType item) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@Nullable
@Override
public String convert(ItemType item) {
@Override
public @Nullable String convert(ItemType item) {

@Nullable
@Override
public String convert(ItemType item) {
if (!(item.getMaterial() == Material.PLAYER_HEAD)) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!(item.getMaterial() == Material.PLAYER_HEAD)) {
if (item.getMaterial() != Material.PLAYER_HEAD) {

lol havent seen this in a while

return null;
}
ProfileProperty texture = profile.getProperties().stream()
.filter(p -> p.getName().equals("textures"))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.filter(p -> p.getName().equals("textures"))
.filter(property -> property.getName().equals("textures"))

p doesnt really explain what you're checking here

Comment on lines +80 to +84
if (!(texture == null)) {
return texture.getValue();
} else{
return null;
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!(texture == null)) {
return texture.getValue();
} else{
return null;
}
if (texture == null) {
return null;
}
return texture.getValue();

also use !=

return "skull texture";
}

}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
}

@Efnilite
Copy link
Copy Markdown
Member

additionally you should target the dev/feature branch

@sovdeeth sovdeeth changed the base branch from master to dev/feature March 23, 2026 22:25
@sovdeeth sovdeeth added the feature Pull request adding a new feature. label Mar 23, 2026
@skriptlang-automation skriptlang-automation Bot added the needs reviews A PR that needs additional reviews label Apr 21, 2026
@github-project-automation github-project-automation Bot moved this to In Review in 2.16 Releases Apr 21, 2026
@AnOwlBe
Copy link
Copy Markdown
Author

AnOwlBe commented Apr 22, 2026

Will rewrite this to use 2.15 registersyntax system soon

@sovdeeth
Copy link
Copy Markdown
Member

sovdeeth commented Apr 23, 2026

Will rewrite this to use 2.15 registersyntax system soon

I presume you mean the registration api (2.10/2.14)? There weren't really any syntax registration changes in 2.15, just event-value stuff.

@AnOwlBe
Copy link
Copy Markdown
Author

AnOwlBe commented Apr 23, 2026

Will rewrite this to use 2.15 registersyntax system soon

I presume you mean the registration api (2.10/2.14)? There weren't really any syntax registration changes in 2.15, just event-value stuff.

Idk I just call it 2.15's registersyntax stuff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Pull request adding a new feature. needs reviews A PR that needs additional reviews

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

3 participants