Comments (5)
There isn't currently a way to do this. The main issue is that (server-side) commands are limited in characters, so automatically calling a command like /item replace entity @s inventory.<slot> with <item>
would be restricted to very simple items. In theory it could automatically call /gamemode creative
, then send the item set packet, then /gamemode survival
, but that isn't ideal.
While anything that modifies your inventory doesn't work, the mod currently already supports the client chest, which would allow you to transfer items from a survival server (no op required), but not to a survival server. I believe you can also edit items within the client chest, but I haven't tried it. In theory it should work though. Obviously that isn't really what your looking for.
In theory nbt can be "built" by running successive /data modify|merge
commands on nbt storage. However it would probably be very slow. It would also require a container or entity as an intermediary to transfer the item from nbt storage back into your inventory. Basically this would be automated:
/data modify storage nbteditor:username_rand item set from entity @s Inventory[{Slot:<slot>}]
- Repeatedly, keeping chars under limit:
/data modify storage nbteditor:username_rand <changes in nbt here>
/data remove storage nbteditor:username_rand item.Slot
/summon pig ~ ~ ~ {"nbteditor:username_rand":1b}
/item replace @e[type=pig,nbt={"nbteditor:username_rand":1b},sort=nearest,limit=1] armor.head with stone
/data modify entity @e[type=pig,nbt={"nbteditor:username_rand":1b},sort=nearest,limit=1] Inventory[0] merge from storage nbteditor:username_rand item
/data remove storage nbteditor:username_rand item
/item replace entity @s inventory.<slot> from entity @e[type=pig,nbt={"nbteditor:username_rand":1b},sort=nearest,limit=1] armor.head
/kill @e[type=pig,nbt={"nbteditor:username_rand":1b},sort=nearest,limit=1]
This also doesn't work if the entire path and value of a single tag is longer than the limit (mainly a problem in long strings).
Is there a particular technique mentioned above that you want me to try implementing?
from nbt-editor.
I found another nbt editor plugin: https://github.com/qyl27/NBTEdit, it's not as easy to use but it just needs op and can edit items in survival mode. I don't know much of java and can't find how they do it but i think it could be useful to you.
from nbt-editor.
It looks like that mod is both client-side and server-side, so it only works on modded servers that include that mod (or singleplayer). Mods that are on both the client and server are much more powerful, as they can have things like a custom survival mode item editing packet. Generally I would like to keep this mod fully client-side, as it gives more flexibility to where it can be used; it works in vanilla servers, and even forge servers that don't require client side mods.
I have been considering making this mod server-side optionally, meaning that all of the current features still work, but special features like survival-mode editing, entity editing, etc. would be added. I'll look into the concept some more, but I can't guarantee it will come out soon; I don't have much experience with client-server communication in mods.
from nbt-editor.
That would be great, thanks!
from nbt-editor.
I've now added this in v2.0.0!
from nbt-editor.
Related Issues (20)
- Discord server because why not? HOT 1
- Custom Event Show Text Crashing HOT 1
- Gradient Support
- [IMPORTANT BUG] Crashing when opening client chest HOT 7
- Crashing while initializing Client HOT 2
- 1.20.5/1.20.6? HOT 10
- Option that allows you to import or export items from the chest you are standing on. HOT 1
- Support for Paper servers.
- 1.21 support HOT 6
- Conflicts with fake player mods on dedicated servers - reported by ChickenDGuy HOT 1
- Expanding the chat. HOT 1
- [Feature Request] Expansions of /get lostitem, similar to NBT Void
- Item bugging? HOT 6
- Event edit in books crash HOT 2
- "Unbreakable" tag has to be written manually HOT 2
- /get hdb error
- add "middle-click to get Skull Value" to /get hdb
- Bug: Can't Delete Find HOT 1
- Suggestion: More History HOT 1
- Suggestion: Export Selection as NBT HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nbt-editor.