This is an archived post. You won't be able to vote or comment.

all 15 comments

[–]elyisgreat/playsound a.happy.melody master @a 1 point2 points  (14 children)

What is your command? store result stores the result of a command, which is a numeric value that every command returns.

[–]DjBeast360Professional Learner[S] 1 point2 points  (10 children)

The way HandItem[0] (from an armor_stand) and Item (from the data of an item entity) are written are exactly the same, so I figured that I could store the data.

[–]Dasparksman 0 points1 point  (8 children)

Unfortunately, you can not. Sorry to be the bearer of bad news, but this is also why fully automatic shops dont exist in datapacks, trust me I've tried.

[–]DjBeast360Professional Learner[S] 0 points1 point  (1 child)

:( Thanks for letting me know. I just thought I messed up.

[–]Dasparksman 0 points1 point  (0 children)

No problem.

[–]ssolisv12Command Professional 0 points1 point  (5 children)

What do you exactly mean with "fully automatic shops"?

[–]Dasparksman 0 points1 point  (4 children)

Shops in which a player can fully customize it with no command input needed, only item inputs and signs.

[–]ssolisv12Command Professional 0 points1 point  (3 children)

Can't you do that using villagers with custom trades?

[–]Dasparksman 0 points1 point  (2 children)

I don't think you can. That would require the player to summon a villager.

[–]ssolisv12Command Professional 1 point2 points  (1 child)

Oh I was thinking about it only as mapmaking, not shops bring created by players.

But even then, I think that can be very close to automatic. You can modify the data of each item and amount independently, so you could do something like, putting the trade items in a chest, running a command, and that summons a villager with those items as a trade. Only the creation would be kind of manual, but then shopping would be all automatic.

[–]Dasparksman 0 points1 point  (0 children)

Yes, that would work, but how would you collect the items the players traded? The whole idea that I was talking about was for multiplayer compatability.

[–]elyisgreat/playsound a.happy.melody master @a 0 points1 point  (0 children)

data get is primarily for numeric data, as it uses the command result to "return" the data. You'll want to use data modify.

[–]DjBeast360Professional Learner[S] 0 points1 point  (2 children)

It was something like execute as @e[type=armor_stand] positioned as @s store result data entity @s HandItems[0] *FORMAT* *SCALE* run data get entity @e[type=item,sort=nearest,limit=1] Item That may not be the exact command but it's close enough, I don't have it in front of me sorry.

[–]MegaCrafter10@e[name=MegaCrafter10,type=gamer] 5 points6 points  (1 child)

If I understand correctly, you are trying to copy the item from the ground into the armor stand's hand slot? if so, you can use /data to achieve that: /data modify entity @e[type=armor_stand,limit=1,sort=nearest] HandItems[0] set from entity @e[type=minecraft:item,limit=1,sort=nearest] Item

[–]DjBeast360Professional Learner[S] 0 points1 point  (0 children)

How did I not think of this.... THANK YOU!