Clumps

Clumps

206M Downloads

Breaks datapacks attempting to summon custom value xp

litoj opened this issue ยท 2 comments

commented

It was always like this.
You can manually modify the value by changing the XP_Orb.clumpedMap.Value = count. This means custom values can be stored only by changing the count, not the value (that would have to be 1).
The main issue is that when a function creates the orb, let's say like this:

scoreboard players set @s counter 100

summon experience_orb ~ ~ ~ {Value:1s,Count:1}
execute store result entity @e[type=experience_orb,distance=0,limit=1] Value short 1 run scoreboard players get @s counter

even if adjusted to supposedly work with this mod:

execute store result entity @e[type=experience_orb,distance=0,limit=1] clumpedMap.1 int 1 run scoreboard players get @s counter

it doesn't affect anything.
If the original vanilla approach is used, the Value and Count will stay the same, but if clumpedMap is changed by the function, it nullyfies the Value completely, despite working as expected when the same command is executed by the user.

I would guess it could have something to do with changing the clumpedMap in the same tick it was created, but only because I have no idea what else could cause this.

commented

Weird, I spent about an hour trying different ways how I could do this differently and nothing worked yesterday. But I must have had something else wrong, because it works for me now too ๐Ÿ˜… .

commented

I'm not sure if I'm doing this right, I do not use mcfunctions at all, this is my first time, but it appears to be working just fine for me?

What I did was run these commands (outside of a function)

scoreboard objectives add counter dummy
scoreboard objectives setdisplay sidebar counter
kill @e[type=minecraft:experience_orb]
function minecraft:test
data get entity @e[type=minecraft:experience_orb,limit=1]

Which produces:

{
	Motion: [0.0d, 0.0d, 0.0d],
	Health: 0s,
	Invulnerable: 0b,
	Air: 300s,
	OnGround: 1b,
	Count: 1,
	PortalCooldown: 0,
	Rotation: [0.0f, 0.0f],
	FallDistance: 0.0f,
	CanUpdate: 1b,
	Pos: [7.4969371483242035d, -60.0d, 8.355429984079462d],
	Fire: -1s,
	Value: 100s,
	UUID: [I; -1940719659, 295781633, -1984165862, 2051696399],
	clumpedMap: {
		1: 100
	},
	Age: 54s
}

Which if I understand how this works, has the right data, clumpedMap is set to 100, so is value.

I did test this in fabric 1.19.3, not sure what mc version and loader you are using