improve logic using only still_timeout instead of NoAI

This commit is contained in:
2025-12-24 23:55:11 +00:00
parent 43f615850c
commit a685133fa2
3 changed files with 6 additions and 4 deletions

View File

@@ -11,7 +11,7 @@
"color": "gold"
},
{
"text": "/trigger stationary_happy_ghast while near a happy ghast to toggle this behavior.\n",
"text": "/trigger ghastflymode while near a happy ghast to toggle this behavior.\n",
"color": "yellow"
}
],

View File

@@ -1,3 +1,5 @@
execute as @s[nbt={still_timeout:10}] as @s[nbt={NoAI:1b}] run data modify entity @s NoAI set value 0b
# set happy ghasts (with ghastflymode true) to have still_timeout 10
execute as @s run data modify entity @s still_timeout set value 10
execute unless entity @s[nbt={still_timeout:10}] unless entity @s[nbt={NoAI:1b}] run data modify entity @s NoAI set value 1b
# clear still_timeout from ghasts being actively ridden by players
execute as @e[type=minecraft:player] on vehicle if entity @s[type=minecraft:happy_ghast] run data modify entity @s still_timeout set value 0

View File

@@ -1,3 +1,3 @@
scoreboard players reset @s ghast_parking_state
data modify entity @s NoAI set value 0b
#data modify entity @s NoAI set value 0b