Browse Source

新的混合物品种类(清空物品栏,换取……)

龙腾猫跃 3 years ago
parent
commit
8f70c51581

+ 1 - 0
data/.gitignore

@@ -0,0 +1 @@
+~$*

+ 1 - 0
data/item/functions/bonus_item/bonus_item_tag.json

@@ -7,6 +7,7 @@
     "bonus_add_score":15,
     "bonus_stole_score":3,
     "bonus_gold":3,
+    "clean_inventory":true,
     "bonus_give_items":[
         {"id":"minecraft:stone","Count":64,"tag":{"is_bonus":true,"display":{"Name":"\"普通的石头\""}}},
         {"id":"minecraft:arrow","Count":64,"tag":{"is_bonus":true}}

+ 5 - 1
data/item/functions/bonus_item/call_each.mcfunction

@@ -11,7 +11,11 @@ function lib:sounds/hit
 # 显示拾取提示(获得积分的提示由 add_score 显示,获得随机物品则该物品不显示)
 execute unless data storage item:bonus item.tag.bonus_add_score unless data storage item:bonus item.tag.bonus_stole_score unless data storage item:bonus item.tag.bonus_gold unless data storage item:bonus item.tag.bonus_random_bonus[0] run tellraw @a ["",{"text": ">> ","color":"aqua","bold": true},{"selector": "@s","color":"aqua"}," 获得了 ",{"nbt": "item.tag.item_name","storage":"item:bonus","interpret": true}]
 
-# 如果有 return 标签则退回物品(最先执行)
+# 如果有 clean_inventory 标签则清空物品栏
+execute if data storage item:bonus item.tag{"clean_inventory":1b} run tellraw @a ["",{"text": ">> ","color":"red","bold": true},{"selector": "@s","color":"red"}," 的物品栏被清空了……"]
+execute if data storage item:bonus item.tag{"clean_inventory":1b} run clear @s #item:non_game
+
+# 如果有 return 标签则退回物品
 execute if data storage item:bonus item.tag{"bonus_return":1b} run function item:bonus_item/return_item
 
 # 如果有 add_score 标签则增加积分

BIN
data/item/loot_tables/item/document.xlsx


+ 1 - 1
data/item/loot_tables/item/purple.json

@@ -25,7 +25,7 @@
     {
         "type": "minecraft:item",
         "weight": 6,
-        "name": "minecraft:shulker_shell",
+        "name": "minecraft:prismarine_crystals",
         "functions": [
             {
                 "function": "minecraft:set_nbt",

+ 35 - 5
data/item/loot_tables/mixed/blue.json

@@ -1,14 +1,40 @@
 {"pools": [{"rolls": 1,"entries": [
 
+    {
+        "type": "minecraft:item",
+        "weight": 1,
+        "name": "minecraft:blaze_powder",
+        "functions": [
+            {
+                "function": "minecraft:set_count",
+                "count": 5
+            },
+            {
+                "function": "minecraft:set_nbt",
+                "tag": "{\"item_name\":\"{\\\"text\\\":\\\"清空物品栏, 换取 5 积分\\\",\\\"color\\\":\\\"light_purple\\\"}\",\"is_bonus\":1b,\"bonus_new\":1b,\"clean_inventory\":1b,\"bonus_add_score\":5}"
+            }
+        ]
+    },
     {
         "type": "minecraft:loot_table",
-        "weight": 60,
+        "weight": 10,
         "name": "item:item/blue"
     },
     {
         "type": "minecraft:item",
-        "weight": 10,
-        "name": "minecraft:heart_of_the_sea",
+        "weight": 1,
+        "name": "minecraft:blaze_powder",
+        "functions": [
+            {
+                "function": "minecraft:set_nbt",
+                "tag": "{\"item_name\":\"{\\\"text\\\":\\\"清空物品栏, 换取随机橙色道具\\\",\\\"color\\\":\\\"light_purple\\\"}\",\"is_bonus\":1b,\"bonus_new\":1b,\"clean_inventory\":1b,\"bonus_random_bonus\":[{\"type\":\"item\",\"level\":\"purple\",\"count\":1}]}"
+            }
+        ]
+    },
+    {
+        "type": "minecraft:item",
+        "weight": 1,
+        "name": "minecraft:shulker_shell",
         "functions": [
             {
                 "function": "minecraft:set_nbt",
@@ -18,9 +44,13 @@
     },
     {
         "type": "minecraft:item",
-        "weight": 10,
-        "name": "minecraft:heart_of_the_sea",
+        "weight": 1,
+        "name": "minecraft:shulker_shell",
         "functions": [
+            {
+                "function": "minecraft:set_count",
+                "count": 2
+            },
             {
                 "function": "minecraft:set_nbt",
                 "tag": "{\"item_name\":\"{\\\"text\\\":\\\"随机蓝色道具 x2\\\",\\\"color\\\":\\\"light_purple\\\"}\",\"is_bonus\":1b,\"bonus_new\":1b,\"bonus_random_bonus\":[{\"type\":\"item\",\"level\":\"green\",\"count\":2}]}"

+ 35 - 5
data/item/loot_tables/mixed/green.json

@@ -5,15 +5,41 @@
         "weight": 25,
         "name": "item:score/green"
     },
+    {
+        "type": "minecraft:item",
+        "weight": 5,
+        "name": "minecraft:blaze_powder",
+        "functions": [
+            {
+                "function": "minecraft:set_count",
+                "count": 4
+            },
+            {
+                "function": "minecraft:set_nbt",
+                "tag": "{\"item_name\":\"{\\\"text\\\":\\\"清空物品栏, 换取 4 积分\\\",\\\"color\\\":\\\"aqua\\\"}\",\"is_bonus\":1b,\"bonus_new\":1b,\"clean_inventory\":1b,\"bonus_add_score\":4}"
+            }
+        ]
+    },
     {
         "type": "minecraft:loot_table",
-        "weight": 61,
+        "weight": 55,
         "name": "item:item/green"
     },
     {
         "type": "minecraft:item",
-        "weight": 7,
-        "name": "minecraft:heart_of_the_sea",
+        "weight": 5,
+        "name": "minecraft:blaze_powder",
+        "functions": [
+            {
+                "function": "minecraft:set_nbt",
+                "tag": "{\"item_name\":\"{\\\"text\\\":\\\"清空物品栏, 换取随机紫色道具\\\",\\\"color\\\":\\\"aqua\\\"}\",\"is_bonus\":1b,\"bonus_new\":1b,\"clean_inventory\":1b,\"bonus_random_bonus\":[{\"type\":\"item\",\"level\":\"blue\",\"count\":1}]}"
+            }
+        ]
+    },
+    {
+        "type": "minecraft:item",
+        "weight": 5,
+        "name": "minecraft:shulker_shell",
         "functions": [
             {
                 "function": "minecraft:set_nbt",
@@ -23,9 +49,13 @@
     },
     {
         "type": "minecraft:item",
-        "weight": 7,
-        "name": "minecraft:heart_of_the_sea",
+        "weight": 5,
+        "name": "minecraft:shulker_shell",
         "functions": [
+            {
+                "function": "minecraft:set_count",
+                "count": 3
+            },
             {
                 "function": "minecraft:set_nbt",
                 "tag": "{\"item_name\":\"{\\\"text\\\":\\\"随机白色道具 x3\\\",\\\"color\\\":\\\"aqua\\\"}\",\"is_bonus\":1b,\"bonus_new\":1b,\"bonus_random_bonus\":[{\"type\":\"item\",\"level\":\"white\",\"count\":3}]}"

+ 17 - 5
data/item/loot_tables/mixed/purple.json

@@ -2,14 +2,18 @@
 
     {
         "type": "minecraft:loot_table",
-        "weight": 8,
+        "weight": 6,
         "name": "item:item/purple"
     },
     {
         "type": "minecraft:item",
         "weight": 1,
-        "name": "minecraft:heart_of_the_sea",
+        "name": "minecraft:shulker_shell",
         "functions": [
+            {
+                "function": "minecraft:set_count",
+                "count": 4
+            },
             {
                 "function": "minecraft:set_nbt",
                 "tag": "{\"item_name\":\"{\\\"text\\\":\\\"四种品质的道具各一件\\\",\\\"color\\\":\\\"gold\\\"}\",\"is_bonus\":1b,\"bonus_new\":1b,\"bonus_random_bonus\":[{\"type\":\"item\",\"level\":\"purple\",\"count\":1},{\"type\":\"item\",\"level\":\"blue\",\"count\":1},{\"type\":\"item\",\"level\":\"green\",\"count\":1},{\"type\":\"item\",\"level\":\"white\",\"count\":1}]}"
@@ -19,7 +23,7 @@
     {
         "type": "minecraft:item",
         "weight": 1,
-        "name": "minecraft:heart_of_the_sea",
+        "name": "minecraft:shulker_shell",
         "functions": [
             {
                 "function": "minecraft:set_nbt",
@@ -30,8 +34,12 @@
     {
         "type": "minecraft:item",
         "weight": 1,
-        "name": "minecraft:heart_of_the_sea",
+        "name": "minecraft:shulker_shell",
         "functions": [
+            {
+                "function": "minecraft:set_count",
+                "count": 2
+            },
             {
                 "function": "minecraft:set_nbt",
                 "tag": "{\"item_name\":\"{\\\"text\\\":\\\"随机紫色道具 x2\\\",\\\"color\\\":\\\"gold\\\"}\",\"is_bonus\":1b,\"bonus_new\":1b,\"bonus_random_bonus\":[{\"type\":\"item\",\"level\":\"blue\",\"count\":2}]}"
@@ -41,8 +49,12 @@
     {
         "type": "minecraft:item",
         "weight": 1,
-        "name": "minecraft:heart_of_the_sea",
+        "name": "minecraft:shulker_shell",
         "functions": [
+            {
+                "function": "minecraft:set_count",
+                "count": 4
+            },
             {
                 "function": "minecraft:set_nbt",
                 "tag": "{\"item_name\":\"{\\\"text\\\":\\\"随机蓝色道具 x4\\\",\\\"color\\\":\\\"gold\\\"}\",\"is_bonus\":1b,\"bonus_new\":1b,\"bonus_random_bonus\":[{\"type\":\"item\",\"level\":\"green\",\"count\":4}]}"

+ 36 - 6
data/item/loot_tables/mixed/white.json

@@ -2,18 +2,44 @@
 
     {
         "type": "minecraft:loot_table",
-        "weight": 35,
+        "weight": 30,
         "name": "item:score/white"
     },
+    {
+        "type": "minecraft:item",
+        "weight": 5,
+        "name": "minecraft:blaze_powder",
+        "functions": [
+            {
+                "function": "minecraft:set_count",
+                "count": 2
+            },
+            {
+                "function": "minecraft:set_nbt",
+                "tag": "{\"item_name\":\"{\\\"text\\\":\\\"清空物品栏, 换取 2 积分\\\",\\\"color\\\":\\\"white\\\"}\",\"is_bonus\":1b,\"bonus_new\":1b,\"clean_inventory\":1b,\"bonus_add_score\":2}"
+            }
+        ]
+    },
     {
         "type": "minecraft:loot_table",
-        "weight": 51,
+        "weight": 50,
         "name": "item:item/white"
     },
     {
         "type": "minecraft:item",
-        "weight": 7,
-        "name": "minecraft:heart_of_the_sea",
+        "weight": 5,
+        "name": "minecraft:blaze_powder",
+        "functions": [
+            {
+                "function": "minecraft:set_nbt",
+                "tag": "{\"item_name\":\"{\\\"text\\\":\\\"清空物品栏, 换取随机蓝色道具\\\",\\\"color\\\":\\\"white\\\"}\",\"is_bonus\":1b,\"bonus_new\":1b,\"clean_inventory\":1b,\"bonus_random_bonus\":[{\"type\":\"item\",\"level\":\"green\",\"count\":1}]}"
+            }
+        ]
+    },
+    {
+        "type": "minecraft:item",
+        "weight": 5,
+        "name": "minecraft:shulker_shell",
         "functions": [
             {
                 "function": "minecraft:set_nbt",
@@ -23,9 +49,13 @@
     },
     {
         "type": "minecraft:item",
-        "weight": 7,
-        "name": "minecraft:heart_of_the_sea",
+        "weight": 5,
+        "name": "minecraft:shulker_shell",
         "functions": [
+            {
+                "function": "minecraft:set_count",
+                "count": 2
+            },
             {
                 "function": "minecraft:set_nbt",
                 "tag": "{\"item_name\":\"{\\\"text\\\":\\\"随机白色道具 x2\\\",\\\"color\\\":\\\"white\\\"}\",\"is_bonus\":1b,\"bonus_new\":1b,\"bonus_random_bonus\":[{\"type\":\"item\",\"level\":\"white\",\"count\":2}]}"

+ 1 - 1
data/item/loot_tables/score/blue.json

@@ -33,7 +33,7 @@
 {
     "type": "minecraft:item",
     "weight": 7,
-    "name": "minecraft:shulker_shell",
+    "name": "minecraft:prismarine_crystals",
     "functions": [
         {
             "function": "minecraft:set_count",

+ 1 - 1
data/item/loot_tables/score/green.json

@@ -33,7 +33,7 @@
 {
     "type": "minecraft:item",
     "weight": 7,
-    "name": "minecraft:shulker_shell",
+    "name": "minecraft:prismarine_crystals",
     "functions": [
         {
             "function": "minecraft:set_count",

+ 1 - 1
data/item/loot_tables/score/purple.json

@@ -33,7 +33,7 @@
 {
     "type": "minecraft:item",
     "weight": 7,
-    "name": "minecraft:shulker_shell",
+    "name": "minecraft:prismarine_crystals",
     "functions": [
         {
             "function": "minecraft:set_count",

+ 2 - 2
data/item/tags/items/bonus.json

@@ -11,7 +11,6 @@
         "minecraft:golden_apple",
         "minecraft:iron_sword",
         "minecraft:nether_star",
-        "minecraft:trident",
         "minecraft:stick",
         "minecraft:netherite_ingot",
         "minecraft:coal",
@@ -23,8 +22,9 @@
         "minecraft:map",
         "minecraft:diamond",
         "minecraft:diamond_sword",
+        "minecraft:prismarine_crystals",
         "minecraft:shulker_shell",
-        "minecraft:heart_of_the_sea",
+        "minecraft:blaze_powder",
         "minecraft:cobblestone",
         "minecraft:raw_iron",
         "minecraft:iron_ingot",

+ 18 - 0
data/item/tags/items/non_game.json

@@ -0,0 +1,18 @@
+{
+    "values": [
+        "#item:bonus",
+        "bow",
+        "arrow",
+        "tipped_arrow",
+        "golden_apple",
+        "enchanted_golden_apple",
+        "splash_potion",
+        "wooden_axe",
+        "golden_axe",
+        "leather_boots",
+        "iron_boots",
+        "diamond_boots",
+        "netherite_boots",
+        "fishing_rod"
+    ]
+}

+ 2 - 2
data/mini/functions/ass/game/give_stick.mcfunction

@@ -1,7 +1,7 @@
-clear @s stick{game_item:1b}
+clear @s lightning_rod{game_item:1b}
 
 # 返还格子上的物品
 execute if data entity @s Inventory[{Slot:8b}] run scoreboard players set @s item_slot 8
 execute if data entity @s Inventory[{Slot:8b}] at @s run function item:pop_slot/return_item
 
-item replace entity @s hotbar.8 with stick{game_item:1b,display:{Name:'{"text":"击退棒","color":"aqua","italic":false}'},Enchantments:[{id:"knockback",lvl:2}],AttributeModifiers:[{UUID:[I;2,0,2,1],Amount:39.01,AttributeName:"generic.attack_damage",Name:"attack",Slot:"mainhand",Operation:0}],HideFlags:63}
+item replace entity @s hotbar.8 with lightning_rod{game_item:1b,display:{Name:'{"text":"强力击退棒","color":"aqua","italic":false}'},Enchantments:[{id:"knockback",lvl:2}],AttributeModifiers:[{UUID:[I;2,0,2,1],Amount:39.01,AttributeName:"generic.attack_damage",Name:"attack",Slot:"mainhand",Operation:0}],HideFlags:63}

+ 1 - 1
data/mini/functions/ass/tick2.mcfunction

@@ -4,4 +4,4 @@ execute as @a[tag=mini_running,scores={creeperUse=1..}] run function mini:ass/ga
 execute as @a[tag=mini_running,scores={countdown_fast=0}] unless data entity @s Inventory[{Slot:-106b,id:"minecraft:creeper_spawn_egg",tag:{game_item:1b}}] run function mini:ass/game/give_creeper
 
 # 给予击退棒
-execute as @a[tag=mini_running] unless data entity @s Inventory[{Slot:8b,id:"minecraft:stick",tag:{game_item:1b}}] run function mini:ass/game/give_stick
+execute as @a[tag=mini_running] unless data entity @s Inventory[{Slot:8b,id:"minecraft:lightning_rod",tag:{game_item:1b}}] run function mini:ass/game/give_stick

+ 1 - 1
data/mini/tags/items/game_item.json

@@ -1,7 +1,7 @@
 {
     "values": [
         "minecraft:trident",
-        "minecraft:stick",
+        "minecraft:lightning_rod",
         "minecraft:creeper_spawn_egg",
         "minecraft:acacia_planks",
         "minecraft:birch_planks",