mojira.dev
MC-277090

"type=creaking" does not find naturally spawned creakings

It is not possible to target naturally spawned creakings specifically in a target selector.

To reproduce

  1. Find a naturally spawned creaking in an area with no other nearby mobs

  2. /teleport @n[type=creaking,distance=..2] ~ ~ ~

    ❌ The command fails

  3. /teleport @n[type=!player,distance=..2] ~ ~ ~

    ✔ The command succeeds

Linked issues

Comments 8

You need to do creaking_transient to find naturally spawned creaking

Huh, that's interesting. I can't find anywhere outside of target selectors where creaking_transient shows up. I wonder why it was done this way.

I had this happen to me as well. The Creaking mobs only responded to the type=creaking_transient, and when using type=creaking I got an error that said no valid targets were found.

@clamlol I would assume it's because creaking spawned with commands or spawn eggs aren't invulnerable, don't have a connected heart to process, and don't despawn during the day. Those distinctions were probably easier to implement as two separate entities, and "creaking" was the ID given to the player-exposed one for intuition's sake.

I guess that makes sense. Honestly, given that there are two types of llamas and two types of wind charges, I should have expected it would work this way. But I'll never be satisfied with this implementation- the problems it creates when using commands outweigh the development time saved. I hope Mojang does a pass on all these entities in the future- one approach could be to make the "special variants" (spectral arrows, trader llamas, zombie villagers, breeze wind charges, naturally spawned creakings) subclasses of the main entity type instead of some base type which is invisible to commands. Or, alternatively, the base class could simply be "revealed" to the game, and the names updated accordingly, so that we would have eg. type=creaking, type=creaking_unbound and type=creaking_transient, with the first of these encompassing both creaking types.

@clamlol What you are suggesting is already possible with entity type tags. In fact the #arrows tag including both types of arrow already exists in vanilla, and for the time being you could define the others yourself in a simple data pack if you need them.

Oh yeah I completely forgot about those. If this is Mojang's preferred solution, then I hope tags for llamas, wind charges and creakings are added to vanilla, and I hope tags are made to work more intuitively in command suggestions.

clamlol

(Unassigned)

Unconfirmed

(Unassigned)

24w40a

Retrieved