ItemStack

Discussion in 'Skript' started by mathiszec, Apr 1, 2020.

  1. Hi everybody. To begin i want to say I'm a beginer in plugin developpement.
    I want to creat a chest at a certain location and fill in splash health potion (itemstack).

    So the begin of my code work, the chest appears at the location which i wanted but i can't specify the True type to my potion.

    I know there is yet a post that explains that but the class "Potion" didn't work anymore..

    I wanted to ask you the New way to create an ItemStack splash healing potion.

    Thanks and sry for m'y english ><
     
  2. Code (Text):
    set block at {_loc} to chest
    add {youritemhere} to inventory of block at {_loc}
    you could store potion in a variable from in-game (effect commands) then use it in code
     
  3. [i have not say that I'm trying to programming with Java and my server turns on 1.14.4 minecraft version]

    Sry i don't know how to create "code balise", so my code is : "

    Location spawnChest = New Location(payer.getworld(),x,y,z);
    spawnChest.getBlock().setType(Material.CHEST);
    Chest chest = (Chest) spawnChest.getBlock().getState();
    Inventory chestmenu = chest.getInventory();

    for(int i=0; i<27 ; i++)
    {
    ItemStack potion = New ItemStack(Material.SPLASH_POTION,1);
    chest menu.setItem(i,potion);
    } "

    I don't understand how to choice my Potion type because PotionType() didn't work anymore..
     
    #3 mathiszec, Apr 1, 2020
    Last edited: Apr 1, 2020
  4. you're posting this in Skript section, java developers are unlikely to notice your post here
     
  5. Oh I'm sorry, it is here ? In programming ? I don't find a Java section
     

    Attached Files:

  6. it's in Spigot Plugin Development