PowerNBT
[PowerNBT]
PowerNBT moved to spigotmc.org
Powerful NBT editor for CraftBukkit 1.5 and later.
Simple NBT API (for developers).
Works with CraftBukkit, MCPC+, Cauldron, Spigot (fix to forge 1.4.7)
Features
- Browsing and editing NBT tags
- supports items, players, offline-players, entities, blocks, chunks, schematic files and all other nbt files
- save tags to file
- spawn entity with custom nbt tags
- parse mojangson string
- custom colors and unicode symbols
- supports tab-completion
- supports operations copy/paste/cut/swap
- supports variables
All commands
See: commands
Examples
- /
nbt me Inventory remove
- clear inventory
- /
nbt me Inventory = *Bob EnderItems
- get Bob's enderchest to yourself
- /
nbt @Eve remove
- remove file Eve.dat (offline player)
- /
nbt block ExtraType = "Notch"
- set skull owner
- /
nbt * Health = 1000
- set 1000 health to mob, which you select
- /
nbt item ench copy
- copy item enchantments to buffer
- /
nbt item ench paste
- paste enchantments to other item
Permissions
- powernbt.use
Bugs
- 0.8.1-0.8.2:
On command /nbt chunk = ...
invisible players and entities in new chunk.
- If you found a bug, please report me in github:
https://github.com/DPOH-VAR/PowerNBT/issues
Changelog
Version 0.8.2 beta
- added: binary opetarions: ^= , &= , |= , useful to set binary flags
- added: operation: multiplication: *=
- added: operation: spawn entity
- added: value: numbers in binary format
- added: values in mojangson format
- added: object: hand
- added: object: schematic
- added: view mode: binary
- added: silent mode for command
- added: API: read chunk
- added: API: save chunk
- added: API: parse mojangson string
- added: API: spawn entity
- fixed: support cauldron 1.7.10
- bug: invisible players after change chunk data.
- bug: on update blocks after change chunk. cauldron 1.7.10
Version 0.8.1
- added: read/write chunks
Version 0.7.3.1
- fix: work with Cauldron 1.7.2
Tutorials
- How to edit tags
- How to use Tab-Completion
- How to edit mobs into spawners
- How to edit villagers
- How to create custom potions
- How to edit fireworks (RU)
API
See API for documentation and examples
Maven dependency (since 0.7.2)
API for version 0.7.2 and later
Warning
If you add a tag, which is not expected by the client, it may be crashed. Be careful!
Helpful links, about NBT format:
- http://www.minecraftwiki.net/wiki/NBT_format
- http://www.minecraftwiki.net/wiki/Player.dat_Format
- http://www.minecraftwiki.net/wiki/Chunk_format
Github | Maven | Javadoc |
@blablubbabc
I got the same error its a outdated version of powernbt so you need to downgrade bukkit or spigot.
@blablubbabc
What is your version of bukkit and plugin?
Seems to be broken: _ExceptionInInitializerError: null' whenever I run the first item related command.
An extremly powerfull tool, basicly replaces a few tons of plugins.
This was the first plugin i tried out!
This is also one of my favorites.
Can you add the ability to use scripts from paste bin?
i;e /nbt pastebin 7RS20evc
It would then run this pastebin script http://pastebin.com/7RS20evc
Or make it so you can save the scripts too the server box and name them, so something like this would also work
/nbt script scriptName.txt
@Adam_Nox
No. PowerNBT has only "hex" formatting filter.
I can suggest you to use the VarScript plugin + Groovy + NBTTools module
but it is very difficult for the average user
/g>> ( nbt(me).Attributes[1].Base*100 as int ) + "%"
[VarScript] 40%
Is there any way to format, or apply multiplication to values retrieved in queries, for display purposes only?
One specific example, let's say I want to tell a player they have 40% knockback resist. The value that comes back when issuing the query is double base: 0.4. Is there a way to convert that to return just 40%, or as part of chat command response customize at all?
@Adam_Nox
ScoreboardManager mechanism is more complicated than it seems.
and it can not be used with NBT
You must use the Bukkit API for creating and editing scoreboards.
I see at one time you had a scoreboard function, but it wasn't standalone.
Now that bukkit can do scoreboards on it's own, is it possible to create a custom scoreboard that can be formatted and retrieved with a command (so a player can check their stats), or is that way off from what can be done?
I had a decimal place wrong, 0.005 was what I wanted added and it works. Thanks again.
@Adam_Nox
I'll think about adding additional logger
I tested walkSpeed using groovy
/g>> me.walkSpeed
- returns 0.2 (real value)/g>> nbt(me).abilities.walkSpeed
- returns 0.1 (nbt value)/g>> me.walkSpeed += 0.1
- returns 0.3000000029802322Be aware that nbt value is half of real speed
error is 0.000003% on float and 0.00000000000004% on double
do not worry about it.
/nbt me abilities.walkSpeed
- float: 0.1/nbt me abilities.walkSpeed += 0.05
- add float: 0.05/nbt me abilities.walkSpeed
- float: 0.15it works fine with 0.05
/nbt me abilities.walkSpeed += 0.005
- add float: 0.005/nbt me abilities.walkSpeed
- float: 0.155but:
/nbt me abilities.walkSpeed = 0.1
- set float: 0.1/nbt me abilities.walkSpeed += 0.005
- add float: 0.005/nbt me abilities.walkSpeed
- float: 0.105000004little surprise from java =)
@DPOHVAR
It would be nice to have a logfile not cluttered by other bukkit console spam, but yes that is usable for now.
I've read the chunk format article a couple times, still doesn't quite give me the syntax. If I had no php database programming experience, I probably would have never gotten anywhere honestly.
The tags where the rounding issues occured was Attributes[1].Base (knockback res), and possibly abilities.walkSpeed (but not sure on that now that I look at the console and my current nbt values.
The thing with those two is that I use decimal values to increment rather than whole numbers. With walkSpeed, it's very confusing because to get it to increase by only 0.05 I add 0.005. But it works for now.
Let me know if this is going to cause problems later or how to adjust. Thank you.
@Adam_Nox
1) Bukkit logs all executed commands to logfile. Do you need additional information about nbt from logging?
2) You need to understand NBT format
http://minecraft.gamepedia.com/Chunk_format
then use the plugin will be very simple.
Perhaps it difficult to use the buffer and variables. I want to simplify it in the next version
3) "+=" and "add" is same commands
4) 0.1000000004 looks like rounding problem in java. It can happen to float and double. Which tag you edited?
Couple suggestions, one might be implemented already. That is, can we log all the nbt commands run on the server to a file so we can keep track of changes in case something goes weird on us?
Also I had to read through a lot of comments to get the syntax I needed for changing player stats. It's possible it's all covered somewhere, but sometime you ought to compile a list of examples, a very long list involving changing player stats, inventory stuff, everything. This is a very powerful tool, but a bit hard to use for noobs like me.
Also is there any difference between += and using the word 'add'?
I'm getting strange results from add (saw it in earlier comments and I'm on 1.6.4), where I add 0.1 and it adds 0.1000000004 instead.
oh that is effin sweet. Thanks.
@Adam_Nox
Yes: /nbt object property.value += 1
@see commands
Can this support incrementing (adding) to a value rather than just setting a value?
I am working on some custom recipes that increase player stats, so want to add 1 to health or base damage. Any way to do +1 to the current value?
@Axe2760
/nbt gzip:worldname/level.dat Data.SpawnX = ...
How do you edit a value in level.dat?
For example, I want to edit the SpawnX, SpawnY, and SpawnZ values in the world using this plugin, how would I go about doing it?