Skip to main content
Wrote a verified solution to the problem
Source Link
NODO55
  • 2.5k
  • 1
  • 8
  • 32

As many pointed out, the previous solution I wrote does not work. The solution allows mob entities to phase through each-other, but arrows follow different rules. Instead, we can exploit the fact that arrows can be piercing, and force all arrows to have a piercing level. Let's go ham and max that stat out.

In a repeating command block, run:

execute as @e[type=arrow] run data modify entity @s PierceLevel set value 127b

I verified in-game that with this command on, all arrows will pierce through the entities they encounter. You might want to heal your happy ghasts now though


I am keeping the old solution in the answer since people might find this useful for other entity interactions.

Old solution:

I think the best solution especially since you are using happy ghasts as technical entities, is to add a team for the players and their happy ghasts, and set the collision rule such that they cannot be pushed by entities from other teams (like spawned arrows).

In an impulse chain:

team add no_push
# ensures entities in this team can ONLY be pushed by other entities in the team, contrary to the name of the rule
team modify no_push collisionRule pushOtherTeams
# join the no_push team (modify these to suit your needs)
team join no_push @a
team join no_push @e[type=happy_ghast]

More info on /team collision rules

I think the best solution especially since you are using happy ghasts as technical entities, is to add a team for the players and their happy ghasts, and set the collision rule such that they cannot be pushed by entities from other teams (like spawned arrows).

In an impulse chain:

team add no_push
# ensures entities in this team can ONLY be pushed by other entities in the team, contrary to the name of the rule
team modify no_push collisionRule pushOtherTeams
# join the no_push team (modify these to suit your needs)
team join no_push @a
team join no_push @e[type=happy_ghast]

More info on /team collision rules

As many pointed out, the previous solution I wrote does not work. The solution allows mob entities to phase through each-other, but arrows follow different rules. Instead, we can exploit the fact that arrows can be piercing, and force all arrows to have a piercing level. Let's go ham and max that stat out.

In a repeating command block, run:

execute as @e[type=arrow] run data modify entity @s PierceLevel set value 127b

I verified in-game that with this command on, all arrows will pierce through the entities they encounter. You might want to heal your happy ghasts now though


I am keeping the old solution in the answer since people might find this useful for other entity interactions.

Old solution:

I think the best solution especially since you are using happy ghasts as technical entities, is to add a team for the players and their happy ghasts, and set the collision rule such that they cannot be pushed by entities from other teams (like spawned arrows).

In an impulse chain:

team add no_push
# ensures entities in this team can ONLY be pushed by other entities in the team, contrary to the name of the rule
team modify no_push collisionRule pushOtherTeams
# join the no_push team (modify these to suit your needs)
team join no_push @a
team join no_push @e[type=happy_ghast]

More info on /team collision rules

Source Link
NODO55
  • 2.5k
  • 1
  • 8
  • 32

I think the best solution especially since you are using happy ghasts as technical entities, is to add a team for the players and their happy ghasts, and set the collision rule such that they cannot be pushed by entities from other teams (like spawned arrows).

In an impulse chain:

team add no_push
# ensures entities in this team can ONLY be pushed by other entities in the team, contrary to the name of the rule
team modify no_push collisionRule pushOtherTeams
# join the no_push team (modify these to suit your needs)
team join no_push @a
team join no_push @e[type=happy_ghast]

More info on /team collision rules