[EDIT/MISC] PowerNBT v0.6.1b - Ingame NBT editor [1.7.2-R0.1]

Discussion in 'Archived: Plugin Releases' started by DPOH-VAR, Nov 29, 2012.

  1. Offline

    DPOH-VAR

    [PowerNBT]
    Powerful NBT editor for Bukkit and MCPC-Plus
    Version: 0.6.1b
    Features:
    • Browsing and editing NBT tags
    • Supporst tab-completion
    • Edit item AttributeModifiers
    • Customize item names and lore
    • Full support for colors and Unicode
    • Change enchantments and potion effects
    • Save inventory into file and restore
    • Change mob equipment
    • Customize mobspawners, fireworks, mob features
    • Edit .schematic files (WorldEdit)
    • and more!
    Usage:
    see Commands

    Examples:
    change armor color:
    /nbt item display.color = #FFFF00
    change player's health:
    /nbt *Notch HealF = 120
    change item name:
    /nbt item display.Name = "&4BOMB!"
    youtube: edit villager (open)


    API:
    How to use: http://dev.bukkit.org/server-mods/powernbt/pages/api/
    GitHub: http://github.com/DPOH-VAR/PowerNBT

    Download:
    [dev.bukkit.org]
     
  2. Offline

    Beldrama

    Now this will be awesome.
     
  3. Offline

    DPOH-VAR

    updated to 0.2.1
    now supports tab-completion
     
  4. Offline

    ron975

    You should make this into an API type thing with complete Javadocs, along side the commands. It would be great as an abstraction library.
     
    DPOH-VAR likes this.
  5. Offline

    DPOH-VAR

    CraftBukkit already has an API:
    https://github.com/Bukkit/CraftBukk...java/net/minecraft/server/NBTTagCompound.java
    NBT format and available tags:
    http://www.minecraftwiki.net/wiki/Chunk_format
    How to get NBT tag (open)

    Items:
    ((CraftItemStack)object).getHandle().getTag();
    Living entities:
    NBTTagCompound tag = new NBTTagCompound();
    ((CraftLivingEntity)object).getHandle().b(tag);
    -- your code --
    ((CraftLivingEntity) object).getHandle().a(tag); //update
    Entities:

    NBTTagCompound = new NBTTagCompound();
    ((CraftEntity)object).getHandle().c(tag);
    -- code --
    ((CraftEntity) object).getHandle().e(tag); // update

    Blocks:
    Code:
    tag = new NBTTagCompound();
    TileEntity tile = ((CraftWorld) block.getWorld()).getTileEntityAt(block.getX(), block.getY(), block.getZ());
    if(tile!=null) tile.b((NBTTagCompound) tag);
    // -- code --          
    if(tile!=null) {
                    tile.a((NBTTagCompound) tag);
                    int maxDist = Bukkit.getServer().getViewDistance() * 32;
                    for (Player p : block.getWorld().getPlayers()) {
                        if (p.getLocation().distance(block.getLocation()) < maxDist){
                            Packet packet = tile.getUpdatePacket();
                            ((CraftPlayer) p).getHandle().netServerHandler.sendPacket(packet);
                        }
                    }
                }
     
  6. Offline

    CeramicTitan

    Wow this is super cool. :D Great job mate!
     
    DPOH-VAR likes this.
  7. Awesome. Do you have the source available anywhere? I would like to take a look at it. :)
     
  8. Offline

    DPOH-VAR

    Sources is not available (I do not know how to use the github :p )
    Wait for version 0.3
    I completely rewrite it and publish the source code.
     
  9. Okay. I was just looking for some NBT examples with blocks. I'm trying to get the command line from a command block. But I can't find any good info out there.
     
  10. Offline

    DPOH-VAR

    Show Spoiler



    Code:
    NBTTagCompound tag = new NBTTagCompound();
    TileEntity tile = ((CraftWorld) block.getWorld()).getTileEntityAt(block.getX(), block.getY(),block.getZ());
    tile.b(tag);
    // editing
    tag.getString("Command");
    tag.setString("Command","your new command");
    // after editing
    tile.a(tag);

     
    Martin-zz likes this.
  11. Awesome thanks so much. I guess ill have to include craftbukkit in my build path. Right?
     
  12. Offline

    CeramicTitan

    yes
     
  13. Offline

    karatetoes

    the renames are global right?
     
  14. Offline

    DPOH-VAR

    What do you mean?
     
  15. Offline

    bjsnow

    I Think He Means not just yourself can see them?

    Btw Can You give say a skeleton an enchanted item? if so how
     
  16. Offline

    karatetoes

    I believe that if you drop a bow and they walk over it that they will pick it up if that is what you mean :D
     
  17. Offline

    chaseoes

    heycoolitsanotheroes
     
  18. Offline

    DPOH-VAR

    1) Yes.
    2)
    Code:
    {edit item in hand in slot 0}
    /nbt item ench[0].id = short <enchantment id>
    /nbt item ench[0].lvl = short <enchantment level>
    {...}
    /nbt %skel select
    {select skeleton}
    /nbt %skel Equipment[0] = me Inventory[0]
    or
    Code:
    {edit directly:}
    /nbt %skel Equipment[0].id = short <id>
    /nbt %skel Equipment[0].Damage = short <data>
    /nbt %skel Equipment[0].tag.ench[0].id = short <enchantment id>
    /nbt %skel Equipment[0].tag.ench[0].lvl = short <enchantment level>
    /nbt %skel Equipment[0].tag.ench[1].id = short <enchantment id>
    /nbt %skel Equipment[0].tag.ench[1].lvl = short <enchantment level>
    /nbt %skel Equipment[0].tag.display.Name = string "item name"
    {etc}
    or
    Code:
    {edit item in hand}
    /nbt item ench[0].id = short <enchantment id>
    /nbt item ench[0].lvl = short <enchantment level>
    {...}
    /nbt %skel select
    {select skeleton}
    /nbt %skel CanPickUpLoot = byte 1
    {drop item to skeleton}
    /nbt %skel CanPickUpLoot = byte 0
     
  19. Offline

    bjsnow

    Is there any way I can edit the enchantments name? say I it had Feather falling but I wanted to change the name to bob, how would I do this?
     
  20. Offline

    DPOH-VAR

    No.
    But you can set invisible enchantment (id>200). Its name will not be displayed, but item will shine.
    Then edit tag dislpay.Lore to add a text below the name
    Code:
    /nbt item display.Lore[0] = string "\c7Simple magic VI"
     
  21. Offline

    bjsnow

    Already worked this out but thanks.
     
  22. Offline

    DPOH-VAR

    Plugin updated to v0.3.1 for CB 1.4.5 and 1.4.6
    //waiting for approving//
     
    bjsnow and fromgate like this.
  23. Offline

    DPOH-VAR

    Uptated to 0.3.3
    • New commands: cut, swap, view (in range), >> << (move)
    • Supports unicode in tag names (just in case)
    • HTML colors ( for armor and fireworks, example: /nbt item display.color = #FFFF00 )
    • new interface :D
     
  24. Offline

    DPOH-VAR

  25. Offline

    DPOH-VAR

    UPD version 0.4.3.1 + sources
     
  26. Sweet! Gonna check it out!
     
  27. Offline

    DPOH-VAR

    update:
    PowerNBT v0.6.1 beta for bukkit 1.7 (not compatible with 1.6.x)

    - you can't see name of tag (this feature is disabled in minecraft 1.7)

    - if you do not specify a type of numeric value, it will be int or double
    now these commands is correct:
    /nbt compound copy
    /nbt buffer myInt = 15
    /nbt buffer myDouble = 3.14

    - no crashes on mismatch types of numeric values:
    /nbt me HealF = 10 int - correct

    - selection of mobs with "*" and "select" does not work:
    /nbt * HealF = 10 - error
    /nbt %e select - error
    use id[tab] instead of selection.
     

Share This Page