Skip to content

DeathEventListener throws a ThreadViolationException checking for a shooter on Canvas #4889

Open

Description

@AnttiMK

Describe the issue

See title

Exceptions & Other Logs

https://pastes.dev/bR3uWPfJ7b

437ea9039d - Last occurred: 2026-10-03 Occurrences: 1
---- Context 1 ----
Plan v5.9 build 3672
Canvas 26.3-965-3f168ad (MC: 26.3)
Server v26.3.build.965-alpha

org.bukkit.event.entity.PlayerDeathEvent@4df7604a
CraftPlayer{name=FramedOrpheus23, uuid=06672a16-d3b9-4e2e-99a3-5394a07dc95d}

---- Stacktrace ----
java.lang.IllegalStateException: Thread failed main thread check: Accessing entity state off owning region's thread, context=[thread=Folia Region Scheduler Thread #10,class=io.papermc.paper.threadedregions.TickRegionScheduler$TickThreadRunner,region={center=[13, 2],world=minecraft:onboarding}], entity=EntityContext:{self=[{type=Arrow,entity_id=6980918,uuid=909eefad-2668-4d10-a68f-64eff75c27a7,position=(6,278.37,-23.06,-15,446.80),delta=(1.50,0.49,-0.33),aabb=AABB[6278.122861845032, -23.0631670091712, -15447.045777040605] -> [6278.622861845032, -22.5631670091712, -15446.545777040605],removed=DISCARDED,has_vehicle=false,passenger_count=0}]
   ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(TickThread.java:191)
   org.bukkit.craftbukkit.entity.CraftArrow.getHandle(CraftArrow.java:29)
   org.bukkit.craftbukkit.entity.CraftArrow.getHandle(CraftArrow.java:21)
   org.bukkit.craftbukkit.entity.AbstractProjectile.getShooter(AbstractProjectile.java:67)
   Plan-5.9-SNAPSHOT.jar//com.djrapitops.plan.gathering.listeners.bukkit.DeathEventListener.getShooter(DeathEventListener.java:151)
   Plan-5.9-SNAPSHOT.jar//com.djrapitops.plan.gathering.listeners.bukkit.DeathEventListener.findKiller(DeathEventListener.java:109)
   Plan-5.9-SNAPSHOT.jar//com.djrapitops.plan.gathering.listeners.bukkit.DeathEventListener.onDeath(DeathEventListener.java:76)
   org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:71)
   io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:55)
   io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:131)
   org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:627)
   org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerDeathEvent(CraftEventFactory.java:1015)
   net.minecraft.server.level.ServerPlayer.die(ServerPlayer.java:1417)
   org.bukkit.craftbukkit.entity.CraftLivingEntity.setHealth(CraftLivingEntity.java:147)
   survival-7.0.0-SNAPSHOT.jar//fi.realmi.survival.command.impl.SurrenderCommand.lambda$runSurrender$0(SurrenderCommand.java:51)
   io.papermc.paper.threadedregions.scheduler.FoliaEntityScheduler$EntityScheduledTask.accept(FoliaEntityScheduler.java:167)
   io.papermc.paper.threadedregions.scheduler.FoliaEntityScheduler$EntityScheduledTask.accept(FoliaEntityScheduler.java:114)
   io.papermc.paper.threadedregions.EntityScheduler.executeTick(EntityScheduler.java:274)
   net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1628)
   net.minecraft.server.dedicated.DedicatedServer.tickServer(DedicatedServer.java:420)
   io.papermc.paper.threadedregions.TickRegions$ConcreteRegionTickHandle.tickRegion(TickRegions.java:619)
   io.papermc.paper.threadedregions.TickRegionScheduler$RegionScheduleHandle.runTick(TickRegionScheduler.java:581)
   io.canvasmc.canvas.threadedregions.scheduler.AffinitySchedulerThreadPool$TickThreadRunner.run(AffinitySchedulerThreadPool.java:681)
   java.base/java.lang.Thread.run(Thread.java:1474)

Plugin versions

Plan: 650c6ff
CanvasMC 26.3 build 965

Additional information

Activity

  1. added
    BugIssues that contain unintended behavior
    on Oct 3, 2026
  2. AuroraLS3 commented on Oct 3, 2026

    @AuroraLS3
    Collaborator

    It probably throws in some other cases too if the killer and killed players are in different tick regions 🤔

  3. changed the title [-]Killing a player with an arrow throws a ThreadViolationException on Canvas[/-] [+]DeathEventListeners throws a ThreadViolationException checking for a shooter on Canvas[/+] on Oct 3, 2026
  4. changed the title [-]DeathEventListeners throws a ThreadViolationException checking for a shooter on Canvas[/-] [+]DeathEventListener throws a ThreadViolationException checking for a shooter on Canvas[/+] on Oct 3, 2026
  5. AnttiMK commented on Oct 3, 2026

    @AnttiMK
    ContributorAuthor

    I apparently missed the SurrenderCommand.lambda$runSurrender, this is from our surrender command which kills the player, duh.. still a valid bug though xD

  6. AuroraLS3 commented on Oct 3, 2026

    @AuroraLS3
    Collaborator

    Interesting how setHealth makes the player take an arrow to the knee

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIssues that contain unintended behaviorserver: Folia

    Type

    No type

    Projects

    • Status
      INBOX

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions