PaperMC / PaperMC/Paper

Trident doesn't respect AbstractArrow

Open
#2,541 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: accepted type: feature upstream: bukkit
Dominant language
Java
Stars
12.7k
Forks
3.5k
Avg merge
3d 13h
Merged PRs (30d)
11

Description

What behaviour is expected:

The trident to do no damage.

What behaviour is observed:

Trident completely ignored all of the properties.

Steps/models to reproduce:

Listen to ProjectileHitEvent (send a message or something to make sure you know it's listened to), then something along the lines of the following Kotlin snippet

        val projectile = event.entity
// code...
        if (projectile is AbstractArrow) {
            if (projectile is Arrow) {
                projectile.clearCustomEffects()
            }
            projectile.fireTicks = 0 // not known if ignored
            projectile.knockbackStrength = 0 // ignored
            projectile.damage = 0.0 // ignored
            projectile.isCritical = false // not known if ignored
            projectile.pierceLevel = 0 // not known if ignored
        }

        if (main.config.pvpMessage) {
            val msg = when {
                damagerState -> main.messages.pvpNoPvpTarget
                damagedState -> main.messages.pvpNoPvpHitter
                else -> main.messages.pvpNoPvpHitter
            }
            shooter.sendMessage(
                msg.process("target" to damaged)
                    .colour()
            )
        }
Plugin list:

Only a plugin doing this. The project isn't touched in any other way.

Paper build number:

https://owo.whats-th.is/2wJBwV6.png

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue through ProjectileHitEvent using the Kotlin snippet and verify which AbstractArrow properties a trident ignores. Trace the trident entity's handling from that event, then confirm done when the listed properties are respected and the trident causes no damage as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, kotlin
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.