Unify plain and type of for items#8402
Open
sovdeeth wants to merge 6 commits intoSkriptLang:dev/patchfrom
Open
Unify plain and type of for items#8402sovdeeth wants to merge 6 commits intoSkriptLang:dev/patchfrom
sovdeeth wants to merge 6 commits intoSkriptLang:dev/patchfrom
Conversation
1 task
Efnilite
requested changes
Jan 25, 2026
Member
Efnilite
left a comment
There was a problem hiding this comment.
looks good, could use a plain item test
Member
Author
plain is already tested in quite a few places throughout the tests, but if you think a standalone is worthwhile i can do that too |
b099319 to
4c40868
Compare
Efnilite
approved these changes
Jan 31, 2026
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
type ofhas been misleading for users when used with items, as it only clears names and durability, rather than just returning a completely base item representative of the type.plaincan return weird items when used with things that require ItemMeta to differentiate, like potions (returns uncraftable potion) and goat horns (always returns ponder).Solution
Changes both expressions to use a new
getBaseTypemethod on ItemType that replacesaliasCopy. This copies over only the minimum necessary info (potion meta info and goat horn info) to differentiate items. This meansplain strength potionnow actually returns a strength potion, andtype of diamond sword of mendingreturns a diamond sword without enchants.I don't expect this to break anything for the user, but I'm not entirely sure it is 100% safe. Testers are welcome! I've done testing around potions and goat horns and enchantments, and it seems fine to me, but I'm not sure if there's some edge case I'm missing.
Testing Completed
regression test, manual testing
Supporting Information
There's a second option here, where
type ofalways returns the item with no other identifying data. This may be more desirable for thetype ofcould be interpreted as the material alone. However, this meanstype of strength potionisuncraftable potion, andtype of strength potion is type of speed potionreturns true. I don't think these changes are intuitive and could be breaking for users. I am open to counter-arguments, though.Completes: #8144
Related: none
AI assistance: none