mojira.dev
MC-30638

Dropchances do not work in the snapshot

As i tried to spawn an entity with custom dropchances, the custom dropchances didn't work.

What I expected to happen was...:
I expected the mob to, when i opened it with NBT-edit, have it's dropchances set to 1.0.

What actually happened was...:
Instead, they were set to the standard value of 0.85 (and some more numbers)

Steps to Reproduce:
1. Place a command block
2. enter

summon Skeleton ~ ~2 ~ {Dropchances:[1.0,1.0,1.0,1.0,1.0],Equipment:[{id:268},{id:301},{id:300},{id:299},{id:298}]}

3. Power the command block

4. Kill the skeleton (and see it doesn't drop everything), or open the entity in a correct NBT-editor and see that the dropchances are still 0.85xxxx

Attachments

Comments 25

As much as i want to believe you, I entered this:

/summon Zombie ~ ~ ~ {Dropchances:[1.0,1.0,1.0,1.0,1.0],Equipment:[{id:268},{id:301},{id:300},{id:299},{id:298}]}

and it didn't work. Nor in a cmd block, nor in chat.

Well, there is these [ things around my dropchances, but it doesn't display them because it makes the 1.0-tag blue...

I can confirm this as well, I have this and although it does equip it, it doesn't drop it.

summon Zombie ~ ~1 ~-1 {Equipment:[{id:276,tag:{ench:[{id:21,lvl:3}]}},{id:301},{id:300},{id:299},{id:298}],DropChances:[1.0,1.0,1.0,1.0,1.0]}

I confirm again, I've tried this examples:

summon Zombie ~ ~ ~-1 {DropChances:[1.00,1.00,1.00,1.00,1.00],Equipment:[{id:276,tag:{ench:[{id:16,lvl:5}]}},{id:313},{id:312},{id:311},{id:310}]}
summon Zombie ~ ~ ~-1 {DropChances:[1.000,1.000,1.000,1.000,1.000],Equipment:[{id:276,tag:{ench:[{id:16,lvl:5}]}},{id:313},{id:312},{id:311},{id:310}]}
summon Zombie ~ ~ ~-1 {DropChances:[1,1,1,1,1],Equipment:[{id:276,tag:{ench:[{id:16,lvl:5}]}},{id:313},{id:312},{id:311},{id:310}]}
summon Zombie ~ ~ ~-1 {DropChances:[1.0,1.0,1.0,1.0,1.0],Equipment:[{id:276,tag:{ench:[{id:16,lvl:5}]}},{id:313},{id:312},{id:311},{id:310}]}

And... it's stupid but I've tried this too:

summon Zombie ~ ~ ~-1 {DropChances:[0:{val:1}],Equipment:[{id:276,tag:{ench:[{id:16,lvl:5}]}},{id:313},{id:312},{id:311},{id:310}]}
summon Zombie ~ ~ ~-1 {DropChances:[0:{value:1}],Equipment:[{id:276,tag:{ench:[{id:16,lvl:5}]}},{id:313},{id:312},{id:311},{id:310}]}
summon Zombie ~ ~ ~-1 {DropChances:[0:{Value:1}],Equipment:[{id:276,tag:{ench:[{id:16,lvl:5}]}},{id:313},{id:312},{id:311},{id:310}]}
summon Zombie ~ ~ ~-1 {DropChances:[{0:1}],Equipment:[{id:276,tag:{ench:[{id:16,lvl:5}]}},{id:313},{id:312},{id:311},{id:310}]}
summon Zombie ~ ~ ~-1 {DropChances:[{0:1},{1:1},{2:1},{3:1},{4:1}],Equipment:[{id:276,tag:{ench:[{id:16,lvl:5}]}},{id:313},{id:312},{id:311},{id:310}]}

None of them worked and I've extracted the chunk where is the Zombie with MCEdit and opened it with NBTExplorer and all values of "DropChances" has set to "0.85"

Why have none of the mods looked at this?! This is one of the main problems of the map i'm creating at the moment. EVERYONE VOTE FOR IT!

I can confirm this for 13w37a and b. And it's not the only problem : MC-31115

15 more comments

@Thomas Clinton, See Dinnerbone's comment on this page:

This issue is invalid. It works perfectly fine already. You're just giving wrong NBT data

NBT data that is not automatically assigned the correct tag-type will go through a series of checks to determine which tag-type is to be assigned. "0.0" translates to "double". Mojang has already been adamant about manual tag-type assignments being required for cases where they are not automatically assigned. See here:

Confirmed WAI, this is playing with the guts of the game, they do not have to make sense. You have your work-around, work with it

Well it might make sense for the */testfor* command, however I still don't understand then why other tags don't need the data type indices. Also confirmed for *CanPickUpLoot* tag, always needs *b*

Looking through 1.8 with MCP, I notice a hasKey(String key, int type) function that may be the cause of the oddities with commands that create data (like /summon). If hasKey() passes a 'type' that is not 99, the tag being checked will require us to manually define its tag-type. 'int type' would indicate the ID of the tag-type, and is hard-coded (for example: hasKey("DropChances", 9), with 9 being a list-type).

There are a handful of tags that passes a number apart from 99, which includes "CanPickUpLoot", "DropChances", and data inside "DropChances". If it's intentional and required to be non-99, then that's pretty much all there is to it. I don't have any idea what the purpose between labeling as 99 vs a relevant number is because I'm not versed well enough in the code to make any inferences. Since Mojang states that this is intended, then I must assume that there is a valid reasoning behind it (resulting in this report having been closed as invalid).

Using THis command
"/summon Skeleton ~ ~1 ~ {Equipment:[{id:wooden_sword,Count:1},{id:leather_boots,Count:1},{id:leather_leggings,Count:1},{id:leather_chestplate,Count:1},{id:leather_helmet,Count:1}],DropChances:[1.0F,1.0F,1.0F,1.0F,1.0F]}"
Causes the Items to drop EVERY time. If you change the 1.0F to 2.0F they will drop 100% of the time UNDAMAGED.

If you go here http://mcstacker.bimbimma.com/ This tool helps get the correct syntax of commands.
In 1.8.4

Went to 1.7 and Re-tried
Using
"/summon Skeleton ~ ~1 ~ {Equipment:[{id:268,Count:1},{id:298,Count:1},{id:299,Count:1},{id:300,Count:1},{id:301,Count:1}],DropChances:[1.0F,1.0F,1.0F,1.0F,1.0F]}"

Works as well.

Rubisk

Nathan Adams

Confirmed

Minecraft 13w36b, Minecraft 13w39b, Minecraft 1.7

Retrieved