Raw Name Entity Type Support - #8867
Open
erenkarakal wants to merge 3 commits into
Open
Conversation
erenkarakal
requested review from
Pesekjak and
cheeezburga
and removed request for
a team
September 1, 2026 19:06
This comment has been minimized.
This comment has been minimized.
sovdeeth
requested changes
Sep 2, 2026
|
|
||
| static { | ||
| Skript.registerExpression(ExprRawName.class, String.class, ExpressionType.SIMPLE, "(raw|minecraft|vanilla) name[s] of %itemtypes%"); | ||
| register(ExprRawName.class, String.class, "(raw|minecraft|vanilla) name[s]", "itemtypes/entitydatas"); |
Member
There was a problem hiding this comment.
while you're here can you deprecate raw as an option? it's not a good name for it and pretty ambiguous compared to minecraft/vanilla
| @Description("The raw Minecraft material name of the given item. Note that this is not guaranteed to give same results on all servers.") | ||
| @Description(""" | ||
| The raw Minecraft material name of the given item or entity type. | ||
| This expression may return multiple names for item types, but always returns a single name per entity data. |
Member
There was a problem hiding this comment.
might want to specify what exact case this happens in (say, only with aliases?)
| @Override | ||
| public boolean isSingle() { | ||
| return types.isSingle(); | ||
| return getExpr().isSingle(); |
Member
There was a problem hiding this comment.
this is wrong, a single item input can produce non-single output.
It's probably better for items to only produce 1:1 output overall though, and just return the first name.
Comment on lines
+1
to
+12
| test "raw name - entity": | ||
| assert vanilla name of cow is "minecraft:cow" | ||
| assert vanilla name of cave spider is "minecraft:cave_spider" | ||
| assert vanilla names of cow and pig are "minecraft:cow" and "minecraft:pig" | ||
|
|
||
| test "raw name - item": | ||
| assert vanilla name of stone is "minecraft:stone" | ||
| assert vanilla name of oak planks is "minecraft:oak_planks" | ||
| assert vanilla names of grass block and dirt are "minecraft:grass_block" and "minecraft:dirt" | ||
|
|
||
| test "raw name - mixed": | ||
| assert vanilla names of stone, pig, grass block, cow are "minecraft:stone", "minecraft:pig", "minecraft:grass_block", "minecraft:cow" |
Member
There was a problem hiding this comment.
there's no testing of the 1 item - multiple names thing
no testing of raw/minecraft syntax options
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Getting translate components for things that involve entity types requires the raw name of entity, but Skript doesn't support it
Solution
Added support for EntityDatas in ExprRawName.sk, made ExprRawName a PropertyExpression
Testing Completed
Added unit tests for single objects, single objects with spaces, plurals, and mixed plurals + in-game testing
Supporting Information
Completes: none
Related: none
AI assistance: none