#Dumb Backpack System
1 messages · Page 1 of 1 (latest)
Ohhh I see now
I like the part where you can put a backpack inside a backpack into a backpack while in a backpack deep inside a backpack.
How do you handle the data if an item is destroyed? Did you use ItemStack dynamicProperty?
lmao
It's literally endless lol
I don't save data to the world. Seems very limited
What do you mean if an item is destroyed?
Idk how that gui works just by interactions without chest
It's just a server form that looks like a cheat. I've been able to do it for a while. Nothing fancy
Oh yeah seems like it because the ui keeps reopening
Definitely a drawback in using this type of UI
That's cool
Please tell me how you save the data or a way to find the abandoned container identifier. When I say Item is destroyed, I mean: erased to the creative tab, burned by lava, or any action that deletes this Item.
If you're using the ItemStack (the backpack item) as the key reference unique ID for the backpack container. By deleting this item, there will be no longer a matching ItemStack to find the unique ID of this backpack container. From what I find, there's no way to know which backpack container identifier is lost this way.
I just save my data to a SQL database. If an item is "destroyed" I can just bring it back as it sits in a SQL database. You could start a whole new world and I'd still be able to bring it back.
I create a custom unique id for every item. Not every itemstack every item. I can make any item be anything. Want a sword to be a backpack, not a problem, want it to be a potion sure. The item the player holds in their hand can be anything you want it be.
Amazing job! You seem like a fantastic developer, I hope your project goes well!
Hold your horses right there. I wouldn't ever call myself a fanatic developer. More like trash developer lol
lmao
If an item is "destroyed", you will not know what unique ID it was storing (Assuming the unique ID is used to link the itemStack to your database). In that case, how does your database handle it?
basically, the database will keep building up data if this scenario continues to happen, there's a risk of deleting the data since we don't know if the backpack's unique ID is no longer accessible or just being stored for a long time.
"Bringing back the Item" sounds pretty straightforward, but how would you do it without accidentally duplicating the item if it still exists?
I feel like you're overthinking this lol. Why wouldn't I know when an item is deleted? There is no risk of deleting the data.
Since every item gets a unique id one simply checks if that item id is "destroyed" then just assign that data to the new item.
How do you know the item is "destroyed"? Surely, you're not going to just check player inventory for each tick right?
Trying to solve method to save itemstack data on an item safely lmao
That would be insane lol the item would be destroyed if it isn't in any saved inventory.
Just move beyond ItemStack
yeah, that's the thing. You wouldn't know what Item is "destroyed"
If I have control of every inventory how would I not know that lol
Not sure, I feel like I'm just not explaining correctly
I see, is that server exclusive approach?
Not sure what you mean by that, if one wanted to I imagine they could make it generic to all. If I did it others can do it too. I'm not doing anything special.
How does that work? Do you cache the ContainerSlot class?
I have a custom object which holds all the item data. I don't save Minecraft objects. That seems wrong...
Is this Script-API or actual plugin?
All script API.
You know I'll just summarize what I was trying to point out:
- Each ItemStack has a unique ID (that you implemented) representing its functionality and data
- Once this ItemStack was put into a container, dropped to the ground, or any action that removed the item from the player, there's no way to know this action unless you check each container or check for a dropped item. (Basically, determine what inventory update happened)
- Without the information above, the unique ID of that Item can be said in an "inaccessible" or "Unknown" state, where its condition cannot be confirmed by the Script-API since we don't know if the item was just being stored in a container or "destroyed".
- Here's the problem, if it is destroyed, the data associated with that Item would become irrelevant, but there's No way to know it was destroyed since detecting such precise inventory update is not possible with Script-API. An Item could also be "destroyed" if it was dropped to the ground, despawned, or exploded.
- Data that become irrelevant or abandoned would build up in the database, you may delete some to free up space, but by doing so, it risks deleting item data that is still functional.
We don't delete data lol
Ah, so you tank it. That's one way to ignore the problem.
It's not a problem
I mean with an SQL database, it's almost infinite, but for dynamicProperty based database, it's a pain.
Seems like you solved your problem
haha 😂
One problem I know I'll be facing is SQL indexing
But there are methods for resolving that issue
Good luck, bro, It felt like I was questioning an obvious question lol
No worries, always feel free to ask questions. It's how we learn
Yo, Is this use script?
Yo, it only uses script API