diff --git a/data/rx.ec/functions/init.mcfunction b/data/rx.ec/functions/init.mcfunction index 4864998..8abe750 100644 --- a/data/rx.ec/functions/init.mcfunction +++ b/data/rx.ec/functions/init.mcfunction @@ -3,9 +3,6 @@ # #> Creates Objs. Called from Lantern Load -# load -scoreboard players set EnderChest+ load 1 - # objectives scoreboard objectives add rx.ec.headDrop minecraft.dropped:minecraft.player_head scoreboard objectives add rx.ec.openChest minecraft.custom:open_enderchest diff --git a/data/rx.ec/functions/reroll.mcfunction b/data/rx.ec/functions/reroll.mcfunction index 6fb94f4..0d456da 100644 --- a/data/rx.ec/functions/reroll.mcfunction +++ b/data/rx.ec/functions/reroll.mcfunction @@ -6,8 +6,8 @@ function rx.playerdb:api/get_self scoreboard players set $loop rx.temp 0 -function rx.ec:upgrade/gen -function rx.ec:gui/fix +execute in minecraft:overworld run function rx.ec:upgrade/gen +execute in minecraft:overworld run function rx.ec:gui/fix function rx.playerdb:api/save_self # audiovisual diff --git a/data/rx.ec/functions/tick.mcfunction b/data/rx.ec/functions/tick.mcfunction index 742c595..1dfa72d 100644 --- a/data/rx.ec/functions/tick.mcfunction +++ b/data/rx.ec/functions/tick.mcfunction @@ -4,7 +4,7 @@ #> schedule tick loop #> player tick -execute as @a run function rx.ec:player +execute in minecraft:overworld as @a run function rx.ec:player #> kill thrown GUI items kill @e[type=item,nbt={Item:{tag:{rx:{ec:{gui:1b}}}}}] diff --git a/data/rx.ec/functions/upgrade/add_item.mcfunction b/data/rx.ec/functions/upgrade/add_item.mcfunction index 41359a4..13b520c 100644 --- a/data/rx.ec/functions/upgrade/add_item.mcfunction +++ b/data/rx.ec/functions/upgrade/add_item.mcfunction @@ -4,6 +4,8 @@ #> @s: item from rx.ec:upgrade loot table #> add item (called rx.ec:upgrade/gen) +tag @s add rx.ec.spawned + # store and strip data modify storage rx:io playerdb.player.data.rx.ec.upgrade.items append value {item: {}, completed:0b} data modify storage rx:io playerdb.player.data.rx.ec.upgrade.items[-1].item set from entity @s Item @@ -13,12 +15,13 @@ data remove storage rx:io playerdb.player.data.rx.ec.upgrade.items[-1].item.Slot execute store result score $count rx.temp run data get storage rx:io playerdb.player.data.rx.ec.upgrade.items[-1].item.Count # tellraw rx97 [{"score":{"name":"$count","objective":"rx.temp"},"color":"gold"}, " ", {"selector": "@s"}] # construct lore + save -execute at @s unless data storage rx:io playerdb.player.data.rx.ec.upgrade.items[-1].item.tag.display run data modify block -30000000 0 1603 Text1 set value '[{"score":{"name":"$count","objective":"rx.temp"},"color":"#cd31e6"}, " ", {"selector": "@e[type=item,tag=rx.ec.spawned,limit=1,sort=nearest]", "italic": true}]' +execute unless data storage rx:io playerdb.player.data.rx.ec.upgrade.items[-1].item.tag.display run data modify block -30000000 0 1603 Text1 set value '[{"score":{"name":"$count","objective":"rx.temp"},"color":"#cd31e6"}, " ", {"selector": "@e[type=item,tag=rx.ec.spawned,limit=1]", "italic": true}]' execute if data storage rx:io playerdb.player.data.rx.ec.upgrade.items[-1].item.tag.display run data modify block -30000000 0 1603 Text1 set value '[{"score":{"name":"$count","objective":"rx.temp"},"color":"#cd31e6"}, " ", {"nbt": "playerdb.player.data.rx.ec.upgrade.items[-1].item.tag.display.Name", "storage": "rx:io", "interpret": true, "italic": true}]' data modify storage rx:io playerdb.player.data.rx.ec.upgrade.items[-1].lore set from block -30000000 0 1603 Text1 -# remove display +# remove display/skullowner data remove storage rx:io playerdb.player.data.rx.ec.upgrade.items[-1].item.tag.display +data remove storage rx:io playerdb.player.data.rx.ec.upgrade.items[-1].item.tag.SkullOwner # delete item kill @s diff --git a/data/rx.ec/functions/upgrade/gen.mcfunction b/data/rx.ec/functions/upgrade/gen.mcfunction index 66d0004..3c6ab00 100644 --- a/data/rx.ec/functions/upgrade/gen.mcfunction +++ b/data/rx.ec/functions/upgrade/gen.mcfunction @@ -14,10 +14,9 @@ data modify entity af-0-0-0-1 HandItems[0] set value {id:"minecraft:stick",Count scoreboard players operation $temp rx.temp = @s rx.ec.maxPage execute as af-0-0-0-1 run scoreboard players operation @s rx.ec.maxPage = $temp rx.temp execute as af-0-0-0-1 store result entity @s HandItems[0].tag.Enchantments[{id:"minecraft:aqua_affinity"}].lvl short 1 run scoreboard players get @s rx.ec.maxPage -execute at @s as af-0-0-0-1 run loot spawn -30000000 60 1602 fish rx.ec:upgrade ~ ~ ~ mainhand +execute as af-0-0-0-1 run loot spawn -30000000 60 1602 fish rx.ec:upgrade 1000 0 1000 mainhand # say @e[type=item] -execute as @e[type=item,nbt={Item:{tag:{rx:{ec:{spawned:1b}}}}}] run tag @s add rx.ec.spawned -execute as @e[type=item,tag=rx.ec.spawned] run function rx.ec:upgrade/add_item +execute as @e[type=item,nbt={Item:{tag:{rx:{ec:{spawned:1b}}}}}] run function rx.ec:upgrade/add_item # kill af-0-0-0-1 diff --git a/data/rx.ec/functions/upgrade/root.mcfunction b/data/rx.ec/functions/upgrade/root.mcfunction index 8328d12..7d0b54e 100644 --- a/data/rx.ec/functions/upgrade/root.mcfunction +++ b/data/rx.ec/functions/upgrade/root.mcfunction @@ -38,13 +38,13 @@ execute if score $shulker rx.temp matches 1.. run data modify storage rx:temp ec execute if score $shulker rx.temp matches 1.. run data remove storage rx:temp ec.upgrade.tag.BlockEntityTag.Items[{tag:{rx:{ec:{}}}}] execute if score $shulker rx.temp matches 1.. run loot replace entity @s enderchest.0 mine -30000000 0 1602 air{drop_contents:1b} - #> Transform into manual execute if score $book rx.temp matches 1.. run function rx.ec:manual #> Return items unless book execute if score $book rx.temp matches ..0 run data modify storage rx:temp ec.items append from storage rx:temp ec.upgrade execute if score $book rx.temp matches ..0 run data remove storage rx:temp ec.upgrade.tag.display +execute if score $book rx.temp matches ..0 run data remove storage rx:temp ec.upgrade.tag.SkullOwner #> Test for upgrade items execute if score $shulker rx.temp matches 0 if score $book rx.temp matches ..0 run function rx.ec:upgrade/test diff --git a/data/rx.ec/tags/items/upgrade/base.json b/data/rx.ec/tags/items/upgrade/base.json deleted file mode 100644 index bbd1583..0000000 --- a/data/rx.ec/tags/items/upgrade/base.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - "minecraft:shulker_shell" - ] -} \ No newline at end of file