#drop probabilities

1 messages · Page 1 of 1 (latest)

proven badgerBOT
#

<@&1201956957406109788>

Someone will come and help soon!

💬 While you wait, take this time to provide more context and details.

🙇 After a while, hit the Summon Helpers button to ping the helper team. They'll be happy to help you

✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve

quasi stump
#

There are multiple ways to do this.

  • adjust the drop chance in the same command when giving them the bow and repair the bow as long as the skeleton has it
  • set the drop chance to 0 and give it a custom death loot table (which would be better because you don't have to worry about the bow durability)
nova onyx
quasi stump
#

Like this for example:

summon skeleton ~ ~ ~ {HandItems:[{id:"minecraft:bow",count:1,components:{"minecraft:enchantments":{levels:{"minecraft:power":10}}}}],HandDropChances:[0.5F,0.085F]}
#

The tag at the end determines the chance. The first value is the mainhand and the second value is the offhand. 0F - 1F is equal to 0% - 100%.

#

There are also special values:

  • 2 for a 100% drop chance with an undamaged tool.
  • -327.67 to disable the looting enchantment for that item.
nova onyx
quasi stump
#

Didn't you do it with data merge?

#

It is entity nbt, so you have to modify the nbt with data merge or data modify.

#

data merge entity <the selector to the entity> {HandDropChances:[0.5F,0.085F]}

nova onyx
quasi stump
#

add HandDropChances:[0.5F,0.085F], in front of the CustomName tag.

nova onyx
#

in front of :'{"text":"Esqueleto de la muerte","color":"red"}'} ?

quasi stump
#

data merge entity @s {HandDropChances:[0.5F,0.085F], CustomName:'{"text":"Esqueleto de la muerte","color":"red"}'}

nova onyx
#

done, that´s it? or we are missing something else?

quasi stump
#

That's it. You only have to adjust the value to what you think works best.

nova onyx
#

and drop it at maximum durability?

nova onyx
quasi stump
#

if you set it to 2 yes

nova onyx
#

like this?

quasi stump
#

yes

nova onyx
#

what would it be like if I wanted the probability of the skeleton dropping the bow to be 3% and dropping it with full durability?

nova onyx
#

i tried my best, but now the skeleton always drop the bow

#

at least the bow is fully repaired

quasi stump
#

because you set it to 2. That's why.

nova onyx
#

the first 2f is for the durability?

quasi stump
#

no the first is for the mainhand.

nova onyx
quasi stump
quasi stump
nova onyx
quasi stump
#

HandDropChance is an array (an array is basically a list) with 2 float (a float is a real number) values. In your case, the values are 2 (100% drop chance with full durability) for the main hand and 0.2 (20%) for the offhand.

nova onyx
#

got it, i will try, give me a minute

nova onyx
quasi stump
#

Do they have the bow in the offhand? I don't think so.

nova onyx
#

but it still droppping the bow with random durability

nova onyx
quasi stump
#

If you want them to drop with a 20% chance, yes.

nova onyx
quasi stump
#

yes

nova onyx
#

ok, let me check

#

problem

#

they drop the bow with random durability

quasi stump
#

That's the restriction when you want to control it via the HandDropChances tag.

#

If you want more control, you have to create a custom loot table or modify the default one if all skeletons get modified.

nova onyx
quasi stump
#

There are even presets for the vanilla loot tables.

#

You can load the skeleton loot table and add the bow to it.

nova onyx
#

i think i made it