Skip to content

Commit

Permalink
Fix the item disappear when place it in the wrong slot
Browse files Browse the repository at this point in the history
  • Loading branch information
paul90317 committed Apr 21, 2023
1 parent 1e60671 commit f803a51
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion easy_gui/template/slot_type/drop/eh.mcfunction
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
summon item ~ ~1 ~ {Motion:[0.0,0.3,0.0],Item:{id:"minecraft:cookie",Count:1b,tag:{eg:{is:1b,type:label}}},Tags:[egno]}
execute positioned ~ ~1 ~ run data modify entity @e[type=item,sort=nearest,limit=1,nbt={Item:{tag:{eg:{is:1b,type:label}}}}] Item set from block ~ ~ ~ Items[{Slot:<slot>b}]
execute positioned ~ ~1 ~ run data modify entity @e[type=item,sort=nearest,limit=1,nbt={Item:{tag:{eg:{is:1b,type:label}}}}] Item set from block ~ ~-1 ~ Items[{Slot:<slot>b}]
item replace block ~ ~ ~ container.<slot> with air
playsound block.dispenser.dispense ambient @a ~ ~ ~
2 changes: 1 addition & 1 deletion easy_gui/template/slot_type/label/eh.mcfunction
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
summon item ~ ~1 ~ {Motion:[0.0,0.3,0.0],Item:{id:"minecraft:cookie",Count:1b,tag:{eg:{is:1b,type:label}}},Tags:[egno]}
execute positioned ~ ~1 ~ run data modify entity @e[type=item,sort=nearest,limit=1,nbt={Item:{tag:{eg:{is:1b,type:label}}}}] Item set from block ~ ~ ~ Items[{Slot:<slot>b}]
execute positioned ~ ~1 ~ run data modify entity @e[type=item,sort=nearest,limit=1,nbt={Item:{tag:{eg:{is:1b,type:label}}}}] Item set from block ~ ~-1 ~ Items[{Slot:<slot>b}]
item replace block ~ ~ ~ container.<slot> with <item>{eg:{is:1b,type:label}<tag><enchant>,HideFlags:1,display:{Name:'{"text": "<text>","italic":false<color>}'}} 1
playsound block.dispenser.dispense ambient @a ~ ~ ~
<click>
2 changes: 1 addition & 1 deletion easy_gui/template/slot_type/n_left/eh.mcfunction
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
summon item ~ ~1 ~ {Motion:[0.0,0.3,0.0],Item:{id:"minecraft:cookie",Count:1b,tag:{eg:{is:1b,type:label}}},Tags:[egno]}
scoreboard players remove @s eg.n <n>
execute store result block ~ ~ ~ Items[{Slot:<slot>b}].Count byte 1 run scoreboard players get @s eg.n
execute positioned ~ ~1 ~ run data modify entity @e[type=item,sort=nearest,limit=1,nbt={Item:{tag:{eg:{is:1b,type:label}}}}] Item set from block ~ ~ ~ Items[{Slot:<slot>b}]
execute positioned ~ ~1 ~ run data modify entity @e[type=item,sort=nearest,limit=1,nbt={Item:{tag:{eg:{is:1b,type:label}}}}] Item set from block ~ ~-1 ~ Items[{Slot:<slot>b}]
data modify block ~ ~ ~ Items[{Slot:<slot>b}].Count set value <n>
playsound block.dispenser.dispense ambient @a ~ ~ ~

0 comments on commit f803a51

Please sign in to comment.