1

Need Help With Command Stuff

Acidpop's Avatar Acidpop7/14/19 7:14 am
1 emeralds 231 5
7/17/2019 1:38 pm
Pr1zz0n's Avatar Pr1zz0n
Is it possible to make this work for all items without using a million commands?

Posted by Acidpop's Avatar
Acidpop
Level 63 : High Grandmaster Droid
170

Create an account or sign in to comment.

5

Pr1zz0n
07/17/2019 1:38 pm
Level 1 : New Network
Pr1zz0n's Avatar
yes, it's possible with just one command block.... always running command block and it is written in just one line so.... the answer is yes.
help :::: watch yt video i ain expert
1
dragonmaster
07/14/2019 8:27 am
Level 39 : Artisan Dragon
history
dragonmaster's Avatar
If I didn't make a mistake this should work for all items (assuming they don't have a special display setting:



you run a function in a loop from

execute as @e[type=item,nbt={OnGround:1b,Thrower:{}}] at @s run function ...

and in the function you do this:

summon armor_stand ~ ~-1.6 ~-0.5 {ArmorItems:[{id:stone},{},{},{}],NoGravity:1,Pose:{Head:[90.0f,0.0f,0.0f]}}
data modify entity @e[type=armor_stand,distance=..2,sort=nearest,limit=1] ArmorItems[3] set from entity @s Item
kill @s




(summons armorstand, copies item data to head slot, kills item)



you should be able to do a similar thing to get the item back (summon dummy item, copy ArmorItems[3] data to Item data of the dummy item, kill armorstand)




Edit: changed distance=..1 to distance=..2
2
Acidpop
07/14/2019 8:44 am
Level 63 : High Grandmaster Droid
history
Acidpop's Avatar
can't seem to get it to work

these are my original commands:

/execute as @e[nbt={Item:{id:"minecraft:apple"},OnGround:1b}] at @s run summon armor_stand ~ ~-1.7 ~-1 {Invisible:1b,NoGravity:1b,ArmorItems:[{},{},{},{id:"apple",Count:1b}],HandItems:[{},{}],CustomName:"{\"text\":\"item\"}",DisabledSlots:2039583,Pose:{Head:[90f,0f,0f]}}


/execute as @e[nbt={Item:{id:"minecraft:apple"},OnGround:1b}] run kill @s


/execute as @e[name=item] at @s if entity @a[distance=..2,scores={shift=10..}] run give @a[distance=..2,limit=1,scores={shift=10..}] apple


/execute as @e[name=item] at @s if entity @a[distance=..2,scores={shift=10..}] run kill @s


if you don't mind could you fix them?
and could you also try to make it work for the item count
if you don't thanks anyway
1
dragonmaster
07/14/2019 9:14 am
Level 39 : Artisan Dragon
dragonmaster's Avatar
I just noticed I made the distance too short in my second command

increase that to ..2 or ..3 and it should work
1
dragonmaster
07/14/2019 9:35 am
Level 39 : Artisan Dragon
dragonmaster's Avatar
and to get the item back you do this in a loop:



execute at @a[scores={shift=10..}] as @e[distance=..2,type=armor_stand] run function ...


and in the function you do this:

summon item ~ ~ ~ {Item:{id:"minecraft:stone"}}
data modify entity @e[type=item,distance=..2,sort=nearest,limit=1] Item set from entity @s ArmorItems[3]
kill @s
1
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome