mojira.dev
MCPE-133481

Drowned And Piglins codebase for projectiles still work even if you replace the item with a non-projectile base item

Drowned and piglins seem to have an error with their coding in terms of the replaceitem command. The command in use when I want to replace their weapon (mainly a trident or crossbow) with air or any other item, they still shoot either arrows or their tridents at the player, as it feels like an overlook on the coding when looking at it at first glance. I wondered if it was, considering skeletons have multiple behaviors when having melee or projectile weapons, piglins and drowns should have a similar code regarding this since they can wield a crossbow/trident and a melee weapon (which for drowns are still trident when closer to the player).

How to reproduce:

1. Spawn a Drowned or a Piglin (Make sure you have one with either trident or crossbow)
2. Use chat to execute a command or a command block
3. do /replaceitem entity @e[type=(either drowned or piglin)] slot.weapon.mainhand 0 any item data if you want to place one
4. Test it out in Survival regarding the issue

UPDATE:

The spawn events that switch the mobs from a ranged state to a melee state do not switch their events to the according state. Drowneds and Piglins do not follow that rule even if you continuously repeat the spawn event rendered in-game.

Linked issues

Comments 2

caden jeffery biller

I actually had this happen when a drowned killed me and took my fishing rod in survival. (Just a simpler way a causing it) so yea i upvoted this one.

[Mod] OcelotOnesie

Thank you for your report!
After consideration, the issue is being closed as Working as Intended.

Please note, that mechanics of the game may change between updates.
Things such as graphics, sounds, world creation, biomes, redstone, villagers, and animals may not work the same in current versions.

Full Version HistorySnapshot Version HistoryFeature Requests and Suggestions

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

FaraFarX

(Unassigned)

651435

Confirmed

Multiple

1.17.2 Hotfix, 1.19.2 Hotfix, 1.19.10, 1.19.11 Hotfix, 1.20.1 Hotfix, 1.21.22 Hotfix, 1.21.41 Hotfix

Retrieved