[Skript] Stackable Potion 2015-11-15

I present my skript to stack the potions

  1. lkjum111
    Contributors:
    Loris
    (sorry for my bad english)

    Hello !
    I present today my skript to stack the potion.
    Before, i would like to say than skript is very long, and i have developped for just give an exemple in file. It is developped just for healing I and healing I, after you can add your potion than you want to stack !

    CODE:
    Declare variable and options
    p3: your potion
    p4: your potion
    ----------------------------------
    {n.{@p3}} = 0
    etc...
    etc..


    Code (Text):
    options:
        p1: splash potion of healing 1
        p2: splash potion of healing 2
    variables:
        {n.{@p1}} = 0
        {n.{@p2}} = 0

    on load:
        set {n.{@p1}} to 0
        set {n.{@p2}} to 0
    on join:
        set {n.{@p1}} to 0
        set {n.{@p2}} to 0
    on quit:
        set {n.{@p1}} to 0
        set {n.{@p2}} to 0
    on unload:
        set {n.{@p1}} to 0
        set {n.{@p2}} to 0
     

    Now, the command:


    Code (Text):
    command /ppotion:
        permission: potion.stack
        trigger:
            if number of all {@p1} in the inventory of the player = 1:
                set {n.{@p1}} to 1
                remove 2304 {@p1} from player                                                 #=2304=IS=NUMBER=OF=MAX=ITEM=POSSIBLE=IN=AN=INVENTORY=#
                execute console command "/give %player% 373:16453 %{n.{@p1}}%"
     
    Define the commande /ppotion for not influanced with essential.
    if number of all {@p1} in the inventory of the player = 1:
    1 = number of potion in inv
    set variable to 1
    remove potion from in
    give number of variable set, in occurrence, 1

    ========================================
    Vidéo:





    NB: For stack the potion by 6, you must change your configuration of essentials for stacksize of 64 to 6 !

    Thanks, have nice week!
    bertek41 likes this.