Skip to content

Commit

Permalink
Fix 'Random Amount of Same Item' setting not working (1.21)
Browse files Browse the repository at this point in the history
  • Loading branch information
Seeloewen committed Jun 18, 2024
1 parent 9653caf commit 3cc3a08
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,9 @@ execute if score RandomItemGiver rig_GiveItemNow matches 1 if score RandomItemGi
execute as @a if score RandomItemGiver rig_GiveItemNow matches 1 if score RandomItemGiver rig_ItemGiveAmount matches 8 if score RandomItemGiver rig_ItemGiveType matches 2 if score RandomItemGiver rig_GiveItems matches 2 run execute as @a run scoreboard players operation @s rig_RandomItemsReceived += @s ItemsReceivedTemp

#Give random amount of same item between 1 and 64
execute if score RandomItemGiver rig_GiveItemNow matches 1 if score RandomItemGiver rig_ItemGiveAmount matches 8 if score RandomItemGiver rig_ItemGiveType matches 1 if score RandomItemGiver rig_GiveItems matches 2 store result score RandomItemGiver RandomAmountSameItemsNumber run random value 1..64
execute if score RandomItemGiver rig_GiveItemNow matches 1 if score RandomItemGiver rig_ItemGiveAmount matches 8 if score RandomItemGiver rig_ItemGiveType matches 1 if score RandomItemGiver rig_GiveItems matches 2 store result score RandomItemGiver rig_RandomAmountSameItemsNumber run random value 1..64
execute if score RandomItemGiver rig_GiveItemNow matches 1 if score RandomItemGiver rig_ItemGiveAmount matches 8 if score RandomItemGiver rig_ItemGiveType matches 1 if score RandomItemGiver rig_GiveItems matches 2 run function randomitemgiver:give_items/randomsameitems
execute as @a if score RandomItemGiver rig_GiveItemNow matches 1 if score RandomItemGiver rig_ItemGiveAmount matches 8 if score RandomItemGiver rig_ItemGiveType matches 1 if score RandomItemGiver rig_GiveItems matches 2 run execute as @a run scoreboard players operation @s rig_RandomItemsReceived += RandomItemGiver RandomAmountSameItemsNumber
execute as @a if score RandomItemGiver rig_GiveItemNow matches 1 if score RandomItemGiver rig_ItemGiveAmount matches 8 if score RandomItemGiver rig_ItemGiveType matches 1 if score RandomItemGiver rig_GiveItems matches 2 run execute as @a run scoreboard players operation @s rig_RandomItemsReceived += RandomItemGiver rig_RandomAmountSameItemsNumber

#Post that you got an item (if enabled)
execute as @a if score RandomItemGiver rig_GiveItemNow matches 1 if score RandomItemGiver rig_ItemGiveAmount matches 1 if score RandomItemGiver rig_GiveItems matches 2 if score RandomItemGiver rig_ShowItemMessage matches 2 run execute if score @s rig_CanGetItems matches 2 run tellraw @s ["",{"text":"(","color":"gray"},{"text":"\u2738","color":"aqua"},{"text":") ","color":"gray"},{"text":"You received a new item!","color":"aqua"}]
Expand Down

0 comments on commit 3cc3a08

Please sign in to comment.