mojira.dev
MC-122088

The result of /seed does not get properly stored using /execute store

The bug

When /execute store is used to store the result of the /seed command, the wrong value gets stored. Here are some values I found:

  • If the seed is 225704178974273007, the stored value is 1142238703.

  • If the seed is -8136237196898536299, the stored value is -2037713771

  • If the seed is -6529837547381228143, the stored value is -480936559

How to reproduce

  1. Create a new world, or load an existing world

  2. Type /seed to obtain the world seed.

  3. Create a scoreboard objective to store the seed in.
    /scoreboard objectives add seed dummy
    /scoreboard objectives setdisplay sidebar seed

  4. Run the following command to store the world seed in the scoreboard data:
    /execute store result score @s seed run seed

  5. Note that the stored value is different from the actual seed.

  6. Give yourself an item with a custom NBT tag.
    /give @s minecraft:stone{seed:1}

  7. Drop the item on the ground.

  8. Run the following command to store the world seed in the item data:
    /execute store result entity @e[type=item,limit=1] Item.tag.seed int 1 run seed

  9. Get the entity data and note that the stored value different is from the world seed, but the same as the one stored in the scoreboard objective.
    /data get entity @e[type=item,limit=1]

Attachments

Comments 2

This is unlikely to be fixed, as scoreboard values are integers while seeds are longs. To fix this, scoreboard values would need to be changed to allow bigger values. Leaving open though and letting a developer decide.

the same problem occurs when attempting to store into storage when explicitly setting a type of "long"

 

eg:

/execute store result storage t:seed aLong long 1 run seed

=> Seed: [5486814582284274048]

/data get storage t:seed aLong

=> Storage t:seed has the following contents: -847459968L

JochCool

Nathan Adams

Confirmed

/execute-store, /seed

Minecraft 17w46a

Retrieved