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

need to convert old NBT code to lastest

Discussion in 'Development' started by Nora1903, Jul 3, 2018.

  1. Nora1903

    Nora1903 Slime

    Messages:
    82
    GitHub:
    cuongvnz
    I have this old nbt code that working on 3.0.0-alpha3 but now i'm using 3.0.4 , so how to convert this code pls, thanks
    PHP:
                        $heldItem $sender->getInventory()->getItemInHand();
                        if(
    $heldItem->getNamedTag()){
                            
    $nbt = new NBT(NBT::LITTLE_ENDIAN);
                            
    $nbt->setData($heldItem->getNamedTag());
                        }
    error when use it on 3.0.4:
    Code:
    [17:22:31] [Server thread/CRITICAL]: Error: "Cannot instantiate abstract class p
    ocketmine\nbt\NBT" (EXCEPTION) in "plugins/Source-RPGMobs/src/NORA/RPGMobs/Comma
    nds" at line 99
     
  2. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    Last edited: Jul 3, 2018
    HimbeersaftLP likes this.
  3. Nora1903

    Nora1903 Slime

    Messages:
    82
    GitHub:
    cuongvnz
  4. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
  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.