Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Adding/Removing items to/from creative

Comments in 'Plugin Development' started by tankisu01, Sep 30, 2015.

  1. tankisu01
    Offline

    tankisu01 New Member

    Joined:
    Aug 20, 2015
    Posts:
    15
    Minecraft User:
    SuperPuperSteve
    Hello there! I need your help.
    1) How to add blocks/items to creative inv?
    2) How to remove blocks/items from creative?
    Thanks!
  2. AndrewBit
    Offline

    AndrewBit Notable Member

    Joined:
    Jun 18, 2015
    Posts:
    435
    Minecraft User:
    AndrewBit4
    SeifValkierks likes this.
  3. tankisu01
    Offline

    tankisu01 New Member

    Joined:
    Aug 20, 2015
    Posts:
    15
    Minecraft User:
    SuperPuperSteve
    Still unsolved :(
  4. Hotshot_9930
    Offline

    Hotshot_9930 Notable Member Plugin Developer

    Joined:
    May 26, 2014
    Posts:
    665
    Plugins:
    2
    Minecraft User:
    HotshotHD
    What do you mean? You want to make blocks completely invisible/visible in the creative inv.?
  5. tankisu01
    Offline

    tankisu01 New Member

    Joined:
    Aug 20, 2015
    Posts:
    15
    Minecraft User:
    SuperPuperSteve
    Y
    Yes
  6. PocketKiller
    Offline

    PocketKiller Notable Member

    Joined:
    Jul 20, 2015
    Posts:
    741
    PHP:
    $item /*eg. DIAMOND_PICKAXE and DIAMOND_BLOCK*/;
    $damage /* I suggest 0*/;
    item::addCreativeItem(Item::get(Item::$item$damage));
    you can replace add with remove as you like :)
    and yeah, don't use "" in the item name ;)
    Last edited: Sep 30, 2015
  7. tankisu01
    Offline

    tankisu01 New Member

    Joined:
    Aug 20, 2015
    Posts:
    15
    Minecraft User:
    SuperPuperSteve
    Is there any way to parse IDs&DMGs from YML file?
    Anyway thanks :D
  8. PocketKiller
    Offline

    PocketKiller Notable Member

    Joined:
    Jul 20, 2015
    Posts:
    741
    Hmm.. i don't know how to like ID : Damage but from a yml yeah. i can tell you:
    PHP:
        $yml yaml_parse(file_get_contents($this->getDataFolder() . "filename.yml"));
         foreach(
    $yml["items"] as $c):
             
    item::addCreativeItem(Item::get(Item::$c["item"], $c["damage"]));
         endforeach;
    and don't forget to create a new folder next to src called resources and create a file in it called as in $yml variable
    and the format in the yml file will be:
    PHP:
    items:
      - 
    itemDIAMOND_PICKAXE
        damage
    0
      
    itemDIAMOND_SWORD
        damage
    0
    and so on...
    Last edited: Sep 30, 2015
  9. tankisu01
    Offline

    tankisu01 New Member

    Joined:
    Aug 20, 2015
    Posts:
    15
    Minecraft User:
    SuperPuperSteve
    Thanks!

Share This Page

Advertisement