2

Datapack Request

DragonDoggo07 11/10/20 9:33 pm
151
11/11/2020 9:53 pm
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! =)
Posted by
DragonDoggo07
Level 1 : New Miner
0

  Have something to say?

JoinSign in

8

guestds
11/11/2020 1:40 am
Level 20 : Expert Modder
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
2
garlicbreathinator
11/10/2020 9:58 pm
Level 33 : Artisan Loremaster owo
history
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.
3
DragonDoggo07
11/10/2020 10:58 pm
Level 1 : New Miner
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!
2
garlicbreathinator
11/11/2020 12:01 am
Level 33 : Artisan Loremaster owo
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.
3
DragonDoggo07
11/11/2020 6:57 pm
Level 1 : New Miner
Ok thank you for your help!
2
Dab676767
11/10/2020 11:47 pm
Level 34 : Artisan Lemon
I might be able to make this into a datapack but it could take some time
2
DragonDoggo07
11/11/2020 6:56 pm
Level 1 : New Miner
How long do you think it would take? Im in no rush, and would be very grateful if you would!
2
Dab676767
11/11/2020 9:53 pm
Level 34 : Artisan Lemon
It could take an hour or 2 but i am pre-occupied for some time
2

Welcome