Browse Source

Merge branch 'master' of https://github.com/LTCatt/LTW3

LTCatt 5 năm trước cách đây
mục cha
commit
40be1993fc

+ 4 - 2
data/mini/functions/trade/game/villager_tp2.mcfunction

@@ -1,6 +1,8 @@
 tag @s add tpPlayer
-tp @s @a[tag=tempPlayerTp,limit=1]
+data modify entity @s Pos set from entity @a[tag=tempPlayerTp,limit=1] Pos
+data modify entity @s Rotation[0] set from entity @a[tag=tempPlayerTp,limit=1] Rotation[0]
+data modify entity @s Rotation[1] set value 0f
 tag @s add tpTemp
-execute at @a[tag=tempPlayerTp,limit=1] run tp @s ~ ~ ~ ~ 0
+scoreboard players set @s temp 0
 execute at @s run function mini:trade/game/villager_tp3
 execute if entity @a[tag=noVillager,tag=tempPlayerTp] at @s run function mini:trade/game/villager_rebirth

+ 2 - 1
data/mini/functions/trade/game/villager_tp3.mcfunction

@@ -1,3 +1,4 @@
-execute positioned ^ ^ ^0.2 if block ~ ~ ~ #mini:redefined_air if block ~ ~1 ~ #mini:redefined_air if entity @s[distance=..2] run function mini:trade/game/villager_tp3
+scoreboard players add @s temp 1
+execute positioned ^ ^ ^0.2 if block ~ ~ ~ #mini:redefined_air if block ~ ~1 ~ #mini:redefined_air if score @s temp matches ..10 run function mini:trade/game/villager_tp3
 tp @s[tag=tpTemp] ~ ~ ~ facing entity @a[tag=tempPlayerTp,limit=1]
 tag @s remove tpTemp

+ 1 - 0
data/mini/functions/trade/game_init.mcfunction

@@ -2,6 +2,7 @@
 forceload add 1000 5000 1064 5064
 
 scoreboard players reset * emerald
+scoreboard players reset * interactVillager
 scoreboard players set $finish_mode mem 0
 scoreboard players set $survival mem 1
 

+ 2 - 6
data/mini/functions/trade/init.mcfunction

@@ -2,9 +2,5 @@
 scoreboard objectives remove emerald
 scoreboard objectives add emerald dummy "绿宝石数"
 
-scoreboard objectives remove posX
-scoreboard objectives add posX dummy "坐标X"
-scoreboard objectives remove posY
-scoreboard objectives add posY dummy "坐标Y"
-scoreboard objectives remove posZ
-scoreboard objectives add posZ dummy "坐标Z"
+scoreboard objectives remove interactVillager
+scoreboard objectives add interactVillager minecraft.custom:minecraft.talked_to_villager "村民交互"

+ 2 - 0
data/mini/functions/trade/tick2.mcfunction

@@ -1,6 +1,8 @@
 tag @e[type=villager,tag=TradePlayer] remove tpPlayer
 # 处理村民糊脸
 execute as @a[team=playing,gamemode=survival] unless entity @s[nbt={SelectedItemSlot:8}] run tag @s add noVillager
+execute as @a[team=playing,gamemode=survival] if entity @s[tag=noVillager] if score @s interactVillager matches 1.. at @s as @e[type=villager,tag=TradePlayer,distance=..5] run function mini:trade/game/villager_rebirth
+execute as @a[team=playing,gamemode=survival] if score @s interactVillager matches 1.. run scoreboard players reset @s interactVillager
 execute as @a[team=playing,gamemode=survival] if entity @s[nbt={SelectedItemSlot:8}] run function mini:trade/game/villager_tp
 # 归位村民
 tp @e[type=villager,tag=TradePlayer,tag=!tpPlayer] 1000 5 5000

+ 2 - 1
data/mini/tags/blocks/colarmatch_floor.json

@@ -8,6 +8,7 @@
         "minecraft:purpur_block",
         "minecraft:bricks",
         "minecraft:mossy_cobblestone",
-        "minecraft:stone"
+        "minecraft:stone",
+        "minecraft:diamond_block"
     ]
 }