mojira.dev
MCPE-45311

Ghast holding onto its fire charge till the player re-enters it’s vicinity.

Steps to Reproduce
1. In survival mode, approach a ghast until it targets you and it's eyes and mouth turn red.
2. Quickly back out of range of the ghast, or switch to creative mode.
3. Move back in range or switch back to survival mode.

Expected Result
The ghast's face returns to normal after step (2), and after step (3) it turns red and makes its warning/charging sound again before shooting at you.

Observerd Result
The ghast's eyes and mouth remain red after step (2), and after step (3) it shoots at you instantly without any sound.


Original description
Whenever a ghast prepares spit a fireball at me, it continues holding its charge like a charged crossbow the moment I immediately back out of its vicinity. Once I return within its firing range and it looks at me, it silently releases its fireball at me. As you saw from the evidence, the fireball knocked me back quite a bit because it exploded on impact at my feet. On that note, what I’m really worried about is the fact that it can do it silently, which means that sneak-building or mining on a tiny ledge in a very high area with possibly a sea of lava at the bottom with a recently encountered ghast or two below you....is most likely going to translate into a death sentence.

Linked issues

MCPE-54291 Ghast Face MCPE-63450 Ghasts attempt shooting fire balls but fail oddly MCPE-75157 Ghast face stucks on shooting face after loosing track of the player MCPE-82318 Gast MCPE-89186 Ghasts make firing face and then stay like that without firing MCPE-90316 Issue with Ghasts Firing at the Player MCPE-94725 Ghast keep theyr face when they are about to shoot a fireball even if they don't track the player anymore MCPE-101339 If Ghast tries to aim at player and turns around to wall it will never shoot a fireball again and have the fireball spitting face forever. MCPE-102484 Ghasts eyes stay open when they shoot and de aggro on the player MCPE-108234 Ghasts stay in 'attacking' animation for too long MCPE-116893 Ghasts agro on player doesn't reset when ghast loses interest of the player while charging a fireball MCPE-138861 ghast mistake MCPE-139276 ghasts shooting texture stays on and they dont shoot then surprise MCPE-163134 Ghast does not return to passive state texture after attacking player MCPE-176424 Ghast Fireball Charge Locks until back in sight of it MCPE-190833 Skeletons and Ghasts can keep their bow/fire charge 'charged' after losing target on a player, and then fire immediately after the player walks back into their field of view. MCPE-194199 Ghasts keep the firing texture after attempting to shoot a fireball MCPE-201708 When a ghast goes to shoot a fireball, it sometimes won't end up doing so or is heavily delayed (even in singleplayer)

Attachments

Comments

migrated

You can also do this by switching to creative mode.

migrated

It did the same to me but not necessarily when I moved, sometimes the ghast just turned away and then shot instantly as soon as it was facing me again

migrated

Affects 1.16.100.60

kmb600

affects 1.17.20.22

kmb600

affects 1.17.0

BeeTeeKay

Affects 1.16.201

migrated

You can reproduce this easily by drinking invisibility.. the ghast's range of site will be reduced and you wont have to rush out of range

Auldrick

As reported by @unknown above, the suspended ghast attack can also happen because the ghast turns in its flight after it begins launching its fireball, which makes it lose eye contact with the player. I don't believe a ghast should break line of sight after it has begun its attack.

GoldenHelmet

The reason for this bug, and the fix, is twofold:

1. Ghasts cannot uncharge attacks.

Once an entity begins charging a ranged using "minecraft:behavior.ranged_attack", the charging continues and the attack remains charged until either (a) the charge is fired, or (b) the behavior component is removed. So, when the ghast loses its target, it gets stuck in the charged state. This makes sense for charging a mechanism like a crossbow, but not for an organic attack like spitting a fireball. (Unless ghasts are supposed to be mechanical contraptions, which is one theory I've come across.)

The way to fix this is to put "minecraft:behavior.ranged_attack" within a component group that gets added by an angry event and removed by a calm event. In turn, the angry event should be called by the component minecraft:on_target_acquired, and the calm even should be called by the component minecraft:on_target_escape. This makes ghasts lose their charges when they lose their targets. If a player moves out of range and back in, or behind a wall for long enough and then back in sight, the ghast has to re-charge and it will play the warning sound.

[media]

applies this fix.

2. Ghasts continue rendering their charging face after they finish charging, until they shoot or are reloaded.

Strangely, after applying the behavior pack fix above, ghasts continue to show their charged/warning face after they lose their targets. They only revert to the normal face if you relog or move far enough from the ghast that it is no longer rendered, and then move back. This rendering behavior is determined by the following line in the vanilla resource render_controllers\ghast.render_controllers.json:

"textures": [ "Array.skins[variable.ischarging]" ]

Apparently variable.ischarging is set to TRUE when ranged attack charging begins and is not set to FALSE until the charge is fired or the client reloads the actor. The ghast face can be fixed to revert to normal when the ghast has no target by replacing the line above with

"textures": [ "Array.skins[ ( variable.ischarging && query.has_target ) ]"

I have applied this fix in

[media]

. Note that if you only use the resource pack fix, ghasts' faces will return to normal when they stop targeting you, but they will retain their attack charge and shoot without warning when they target you again.

migrated

Affects 1.17.40.20

lythough

Affects 1.20.21 preview

Minecraft386882

Confirmed in 1.21.44

migrated

(Unassigned)

334182, 1388460

Confirmed

Multiple

ghast

1.21.80.27 Preview, 1.21.62 Hotfix, 1.17.11 Hotfix, 1.17.20.21 Beta, 1.16.220.50 Beta, ..., 1.16.101 Hotfix, 1.16.201 Hotfix, 1.16.221 Hotfix, 1.17.2 Hotfix, 1.19.31 Hotfix

Retrieved