2
Datapack Request
Hello, Im not sure if you are allowed to do this on these forums, but Ill give it a shot!
I would like a datapack that has a couple of features
1) a trigger to turn it on and off(This one is less needed, but would be useful)
2) I need a datapack that makes it so that you have a chance of keeping your inventory(I would like 40%), and a 60% chance of just dropping it like vanilla. I am very inexperienced at coding, which is why i am requesting this.
Thanks to anyone that looks at this! =)
I would like a datapack that has a couple of features
1) a trigger to turn it on and off(This one is less needed, but would be useful)
2) I need a datapack that makes it so that you have a chance of keeping your inventory(I would like 40%), and a 60% chance of just dropping it like vanilla. I am very inexperienced at coding, which is why i am requesting this.
Thanks to anyone that looks at this! =)
8
im not sure how to make it a datapack but ive made a structure file here (copy the "generated" folder into the "saves/*world*" folder, or copy the nbt file at the end into the "saves/*world*/generated/minecraft/structures" folder)
using a structure block, load the structure using its name ("minecraft:on-death_commandomizer_2")
the structure area is 6*6*6
redstone based clock is so that its slow enough for the comparator to actually notice it
non stackable items control when its setting to true, stackable items control when set to false
if you change the amount of stackable items, make sure that each one is a different items, as the dropper picks between the slots with items
using a structure block, load the structure using its name ("minecraft:on-death_commandomizer_2")
the structure area is 6*6*6
redstone based clock is so that its slow enough for the comparator to actually notice it
non stackable items control when its setting to true, stackable items control when set to false
if you change the amount of stackable items, make sure that each one is a different items, as the dropper picks between the slots with items
This would be very simple to make. It basically boils down to
setup (run this set of commands once at world spawn to set up/reset the system):
kill @e[tag=Inventory_RNG]
summon minecraft:armor_stand ~ ~ ~ {Marker:1b, Invisible:1b,Tags:["Inventory_RNG","Drop"]}
summon minecraft:armor_stand ~ ~ ~ {Marker:1b, Invisible:1b,Tags:["Inventory_RNG","Drop"]}
summon minecraft:armor_stand ~ ~ ~ {Marker:1b, Invisible:1b,Tags:["Inventory_RNG","Drop"]}
summon minecraft:armor_stand ~ ~ ~ {Marker:1b, Invisible:1b,Tags:["Inventory_RNG","Keep"]}
summon minecraft:armor_stand ~ ~ ~ {Marker:1b, Invisible:1b,Tags:["Inventory_RNG","Keep"]}
loop (run this every tick via function or repeating command block chain):
tag @e[tag=Inventory_RNG,limit=1,sort=random] add Selected
execute as @e[tag=Inventory_RNG,tag=Drop,tag=Selected] run gamerule keepInventory false
execute as @e[tag=Inventory_RNG,tag=Keep,tag=Selected] run gamerule keepInventory true
tag @e[tag=Inventory_RNG] remove Selected
Since this uses keepInventory, it is different every tick, not for each player. You can change the chances by spawning different numbers of armor stands when you set it up.
setup (run this set of commands once at world spawn to set up/reset the system):
kill @e[tag=Inventory_RNG]
summon minecraft:armor_stand ~ ~ ~ {Marker:1b, Invisible:1b,Tags:["Inventory_RNG","Drop"]}
summon minecraft:armor_stand ~ ~ ~ {Marker:1b, Invisible:1b,Tags:["Inventory_RNG","Drop"]}
summon minecraft:armor_stand ~ ~ ~ {Marker:1b, Invisible:1b,Tags:["Inventory_RNG","Drop"]}
summon minecraft:armor_stand ~ ~ ~ {Marker:1b, Invisible:1b,Tags:["Inventory_RNG","Keep"]}
summon minecraft:armor_stand ~ ~ ~ {Marker:1b, Invisible:1b,Tags:["Inventory_RNG","Keep"]}
loop (run this every tick via function or repeating command block chain):
tag @e[tag=Inventory_RNG,limit=1,sort=random] add Selected
execute as @e[tag=Inventory_RNG,tag=Drop,tag=Selected] run gamerule keepInventory false
execute as @e[tag=Inventory_RNG,tag=Keep,tag=Selected] run gamerule keepInventory true
tag @e[tag=Inventory_RNG] remove Selected
Since this uses keepInventory, it is different every tick, not for each player. You can change the chances by spawning different numbers of armor stands when you set it up.
So this is all in game and not a datapack right? And if so would it be possible to make it a datapack in some way? Again, very inexperienced with Datapack creation, fact is, Ive never done it.
Thanks!
Thanks!
Since this is such a simple concept, I just wrote the commands out off the top of my head instead formatting it as a datapack. The datapack would just run this code from a file. With a little time, a toggle and built-in probability changer would be easy to add as well.
I am busy with other projects and honestly think relying on chance for something like this is a bad idea. I don't have the time to add the management tools and save it as a datapack myself. Perhaps I could add a "soulbound" enchantment that lets you keep items after death though.
I am busy with other projects and honestly think relying on chance for something like this is a bad idea. I don't have the time to add the management tools and save it as a datapack myself. Perhaps I could add a "soulbound" enchantment that lets you keep items after death though.
Ok thank you for your help!
I might be able to make this into a datapack but it could take some time
How long do you think it would take? Im in no rush, and would be very grateful if you would!
It could take an hour or 2 but i am pre-occupied for some time
