Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-260705

Interaction entities always register that hits on them deal 1 damage, no matter how much damage you would normally be doing

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.19.4 Pre-release 3, 1.20.2
    • None
    • Community Consensus
    • Entities
    • Low
    • Platform

      Basically what the title says - if you punch an Interaction entity, the damage that gets passed through to the game is always exactly 1 damage. This can be seen through advancement triggers, like the following:

      {
          "criteria": { "click-interaction": {
              "trigger": "minecraft:player_hurt_entity",
              "conditions": {
                  "damage": { "dealt": { "min":0, "max":2 }},
                  "entity": { "type": "minecraft:interaction" }
              }
          }},
          "rewards": { "function": "<insert function here>" }
      }
      

      For the reward function, I would just do something simple to let you know the trigger was activated, like play a sound and then revoke the advancement.

      If you play around with the "min" and "max" fields under the damage condition, you'll find that no matter how much damage you're supposedly doing (like your fist vs a netherite sword), the trigger will ALWAYS be activated if the range includes the value 1, and will NEVER activate otherwise. Thus, I assume it's always passing in a value of exactly 1.

      EDIT - After some further testing, I have a guess at the source of this bug: it appears that hits on an interaction are not registered as the same "type" of hits as an attack on a regular mob. For example, they don't reduce weapon durability, and they don't activate additional effects like sweeping edge or fire aspect. This is probably a good thing in and of itself, but it also seems like the info on dealt damage is lost in a similar way, which I would interpret as a bug.

      If all else fails, a good fix might be to add an additional NBT tag to interactions, something like DamagingInteractions:<true/false> which makes hits on the interaction act exactly like hits on a mob in terms of effects (durability, damage, sweeping edge, etc). It would default to false, in which case the current behavior would take effect.

            Unassigned Unassigned
            stormconure Conure
            Votes:
            4 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              CHK: