mojira.dev
MC-235045

Entity type tags suggestions don't work in target selectors

The Bug

This was found while messing around in a 1.17.1 single-player world with target selectors and entity type tags.

[media]

As you can see, the minecraft:raiders tag doesn't offer completions in singleplayer.

Steps to Reproduce

  • Paste the following command into chat without executing it.

    /kill @e[type=#minecraft:raid
  • Hit the TAB key in an attempt to suggest the "#minecraft:raiders" entity type tag.

  • Look at the command suggestions list.

  • Take note as to whether or not entity type tags are suggested in command suggestions.

Observed Behavior

Entity type tags are not suggested in command suggestions.

Expected Behavior

Entity type tags would be suggested in command suggestions.
 

Potential Fix

I fixed the issue using a modified server with the attached patch. The issue stems from the silent failure of commands with target selector with invalid entity tags attached to the "type" option. I fixed it by throwing a parse exception if the tag wasn't found.

With my fix applied on a modified server, I got

[media]

Linked issues

Attachments

Comments 5

⚠️ Your bug report has been marked as private, as it contains some sensitive privacy information (e.g. an email address or session ID).

-- I am a bot. This action was performed automatically! If you think it was incorrect, please notify us on Discord or Reddit

Can confirm this behavior. Also affects 21w42a. Here are some extra details regarding this problem.

The Bug:

Entity type tags are not suggested in command suggestions.

Steps to Reproduce:

  • Paste the following command into chat without executing it.

/kill @e[type=#minecraft:raid
  • Hit the TAB key in an attempt to suggest the "#minecraft:raiders" entity type tag.

  • Look at the command suggestions list.

  • Take note as to whether or not entity type tags are suggested in command suggestions.

Observed Behavior:

Entity type tags are not suggested in command suggestions.

Expected Behavior:

Entity type tags would be suggested in command suggestions.

Can still reproduce this behavior on 1.18.1

Confirmed for 22w14a. They suggest, but only if =! is used. Regardless of = or =!, typing a # removes them from suggestions. Hopefully they fix this because I’m sure it’s useful and also it’s unlike other commands that support tags (like /locate and /locatebiome which both support and suggest tags just fine).

Still affects 1.20-rc1

Machine Maker

(Unassigned)

Confirmed

Platform

Low

Commands

1.17.1, 21w42a, 1.18.1, 22w06a, 1.18.2, ..., 23w32a, 1.20.4, 23w51b, 1.21.4, 25w02a

Retrieved