LastOutput represents the last line of output generated by the command block. Since that line is a string, the /execute store command returns the length of that line (which is 84 in your case).
Instead of reading the number from the output, you can access that number directly:
execute store result score <player> <objective> run fill <x> <y> <z> <x2> <y2> <z2> <block>
this will store the amount of blocks affected by the /fill command into the specified objective.
Edit:
if you want to keep track of how many blocks we're affected in total, here is how you can do that.
You need two scoreboard objectives of type dummy. I will call mine "count" and "total". Once you have two objectives, place down a command block (it can be an impulse or repeating command block) and paste this command in:
execute store result score @p count run fill ...
attach a chain command block to the one you just placed down and set it to always active. Paste this in:
execute as @p run scoreboard players operation @s total += @s count
this will store the number of affected blocks into "count" and add its value to "total".
Method #1: Correction. First teleport according to your command, then in the same tick change the rotation back to horizontal with this command:
/data modify entity @e[type=armor_stand,limit=1] Rotation[1] set value 0f
This might have the side effect that the armour stand is occasionally visible looking up or down for one frame, but it did not ever happen when I tried it. It might be different on a laggy server.
Method #2: Dummy entity. Have a dummy entity that is always at the player's X and Z coordinate, but at the armour stand's Y coordinate and let the armour stand look at that instead.
To be absolutely sure that you always target the correct player, you need a function. Execute this function as
and at
every one of your rotating armour stands:
execute at @p run summon armor_stand ~ ~ ~ {Tags:["temp"],Marker:1,Invisible:1,NoAI:1,NoGravity:1,Invulnerable:1}
data modify entity @e[type=armor_stand,tag=temp,limit=1] Pos[1] set from entity @s Pos[1]
tp @s ~ ~ ~ facing entity @e[type=armor_stand,tag=temp,limit=1]
kill @e[type=armor_stand,tag=temp]
The downside of this system is obviously that it's more complicated and that it requires access to the server files, for putting the datapack into the folder. There are certain configurations of player and armour stand positions in which you cannot perfectly select the correct position to look at, at least not for all in one tick, unless you use a function.
Best Answer
Firstly, if you want to get the position into a scoreboard and not into NBT, then you don't need
/execute store result entity
, but/execute store result score
. That also avoids this issue. Here is an explanation of the issue anyway:The argument that the game expects is "
scale
", which allows you to multiply the return value of the/data get
command by a number before storing it. You can also do this in/data get
, see below.It's really weird how the syntax help for that doesn't show up. It actually does appear once you start typing anything at that position, no matter if it's correct or not. I created a bug report about that: https://bugs.mojang.com/browse/MC-173701
Here are the commands you actually want, with scoreboards:
You can add a factor at the end of each of these. For example if you multiply by 50 when reading from NBT and later with 0.02 when reading from the scoreboard, you get the coordinate precise to 20cm. But be careful when using scale factors above 71.58, because you might get overflow issues if the player coordinates are very high. Currently you don't need to worry about Y coordinates above 30 million, because the player gets kicked anyway.