1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

How to update old CompoundTag to new or how to register the recipie?

Discussion in 'Development' started by manyDARK, Jan 29, 2019.

  1. manyDARK

    manyDARK Spider

    Messages:
    8
    GitHub:
    many1337
    I don't understand how working the new CompoundTag.. :(
    (btw I understan only old CompoundTag)

    Console error message:

    PHP:
                $tag = new CompoundTag("", [
                    new 
    ListTag("Recipes", []),
                ]);
                
    $recipes = [[Item::get(Item::BRICK01), Item::get(Item::SANDSTONE22)], [Item::get(Item::BRICK07), Item::get(Item::END_STONE01)]];
                
    $this->recipes[$p->getName()] = $recipes;
                
    $i 0;
                foreach(
    $recipes as $recipe){
                    
    $tag->Recipes[$i] = $this->makeRecipe($recipe[0], $recipe[1], $recipe[2] ?? null);
                    ++
    $i;
                }
                
    $nbt = new NBT;
                
    $nbt->setData($tag);
     
    Last edited: Jan 29, 2019
  2. A354-PH

    A354-PH Baby Zombie

    Messages:
    186
    GitHub:
    Kizu
    Im just bumping this. I want to know how to update CompoundTag
     
  3. Palente

    Palente Slime

    Messages:
    75
    GitHub:
    palente
    xXNiceAssassinlo YT and Primus like this.
  4. manyDARK

    manyDARK Spider

    Messages:
    8
    GitHub:
    many1337
  5. manyDARK

    manyDARK Spider

    Messages:
    8
    GitHub:
    many1337
  6. xXNiceAssassinlo YT

    xXNiceAssassinlo YT Zombie Pigman

    Messages:
    499
    GitHub:
    xXNiceYT
    There is in that link
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.