Solved 1.13 Potion names

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

SoMuchWessel

Active Member
Apr 3, 2017
147
3
18
47
Hi there,
I ran into a problem.

I normally used code like "water bottle:11" to get a drinkable jumpboost 1, but with 1.13 the numberic disappeared.
I can not find the allias connected to the potions, just the name "water bottle".
With splashpotions skript is saying its: "Splash potions of strong speed", no matter what splash potion.

What is the right way to use potions now in 1.13?
 
If im not mistaken, the data is now saved in the items meta
You would need to either add to the NBT of the item (I dont think any addons support NBT in 1.13)
Or you would have to use Skript Mirror to add to the item meta, which could get complicated.
 
If im not mistaken, the data is now saved in the items meta
You would need to either add to the NBT of the item (I dont think any addons support NBT in 1.13)
Or you would have to use Skript Mirror to add to the item meta, which could get complicated.

So there is currently no way to use potions in Skript 1.13 now?
 
Yes there is.
@KingAlterIV created this today on the discord (requires Skript-Mirror)
This is a custom expression you need to put at the top of your skript

code_language.skript:
expression potion of %potion effect% with duration %integer% [and amplifier %-integer%]:
    get:
        set {_e} to expression-3 ? 0
        set {_potion} to potion.getRandom()
        set {_meta} to {_potion}.getItemMeta()
        {_meta}.addCustomEffect(new PotionEffect(expression-1, expression-2, {_e}), true)
        {_potion}.setItemMeta({_meta})
        return {_potion}

and you would use it like so (note the duration is in ticks)
code_language.skript:
give player potion of slowness with duration 1200 and amplifier 1
[doublepost=1542281258,1542281166][/doublepost]oh i forgot that is for CUSTOM potions, for regular potions you can just use the ones in the aliases
https://github.com/SkriptLang/skript-aliases/blob/master/brewing.sk
 
Yes there is.
@KingAlterIV created this today on the discord (requires Skript-Mirror)
This is a custom expression you need to put at the top of your skript

code_language.skript:
expression potion of %potion effect% with duration %integer% [and amplifier %-integer%]:
    get:
        set {_e} to expression-3 ? 0
        set {_potion} to potion.getRandom()
        set {_meta} to {_potion}.getItemMeta()
        {_meta}.addCustomEffect(new PotionEffect(expression-1, expression-2, {_e}), true)
        {_potion}.setItemMeta({_meta})
        return {_potion}

and you would use it like so (note the duration is in ticks)
code_language.skript:
give player potion of slowness with duration 1200 and amplifier 1
[doublepost=1542281258,1542281166][/doublepost]oh i forgot that is for CUSTOM potions, for regular potions you can just use the ones in the aliases
https://github.com/SkriptLang/skript-aliases/blob/master/brewing.sk

Thanks, this worked :emoji_slight_smile:
 
Status
Not open for further replies.