Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash ridding through a nether portal #11437

Open
LucidAPs opened this issue Sep 25, 2024 · 4 comments
Open

Crash ridding through a nether portal #11437

LucidAPs opened this issue Sep 25, 2024 · 4 comments
Labels
status: accepted Disputed bug is accepted as valid or Feature accepted as desired to be added. type: bug Something doesn't work as it was intended to. version: 1.21.1 Game version 1.21.1

Comments

@LucidAPs
Copy link

Stack trace

https://mclo.gs/sute7H7

Plugin and Datapack List

[12:43:31 INFO]: Server Plugins (15):
[12:43:31 INFO]: Bukkit Plugins:
[12:43:31 INFO]: - CMI, CMILib, CommandRestrictor, CustomEnchants, LuckPerms, PlaceholderAPI, ProtocolLib, SimpleClaims, SimpleCrates, SkySquidPlugin
[12:43:31 INFO]: Vault, ViaBackwards, ViaVersion, WorldEdit, WorldGuard

Actions to reproduce (if known)

I am using a plugin that allows players when shooting with a special bow to ride the arrow and dismount it when it lands, I using the following events EntityShootBowEvent , EntityDismountEvent and ProjectileHitEvent

If a player shoots the arrow in overworld through a nether portal it will crash the server.

Paper version

[12:43:43 INFO]: This server is running Paper version 1.21.1-99-master@1bc02e6 (2024-09-25T02:41:02Z) (Implementing API version 1.21.1-R0.1-SNAPSHOT)
You are running the latest version
Previous version: 1.21.1-2312-d7a7c91 (MC: 1.21.1)

Other

Is this something that needs to be fixed on paper's side or should I fix it on my plugin?

@papermc-sniffer papermc-sniffer bot added the version: 1.21.1 Game version 1.21.1 label Sep 25, 2024
@Machine-Maker
Copy link
Member

Machine-Maker commented Sep 25, 2024

Have you 100% narrowed it down to the plugin you are working on (i.e. have you removed all other plugins and checked that it still happens)?

If so, can you provide more code or your plugin source for how you are doing this? I could not replicate this issue using the simple

@EventHandler
public void onEvent(EntityShootBowEvent event) {
    event.getProjectile().addPassenger(event.getEntity());
}

I shot a bow at a nether portal in the overworld, and was tp'd to the nether after riding the arrow (was in creative so it's an instant teleport).

@Machine-Maker Machine-Maker added resolution: awaiting response Additional information is required from the issue reporter and removed status: needs triage labels Sep 25, 2024
@LucidAPs
Copy link
Author

Have you 100% narrowed it down to the plugin you are working on (i.e. have you removed all other plugins and checked that it still happens)?

If so, can you provide more code or your plugin source for how you are doing this? I could not replicate this issue using the simple

@EventHandler
public void onEvent(EntityShootBowEvent event) {
    event.getProjectile().addPassenger(event.getEntity());
}

I shot a bow at a nether portal in the overworld, and was tp'd to the nether after riding the arrow.

Hi yes its my plugin, here is the code I am using for it.
https://mclo.gs/IRA8k8l

@Machine-Maker
Copy link
Member

Ok, I was able to replicate it, but it doesn't seem to happen all the time. Sometimes I just end up being dropped of on the block right before the portal. But sometimes I get the error + crash. For anyone else, I modified the code to make it easier to test.

https://pastes.dev/4VX1tNW9lm

@Machine-Maker Machine-Maker added status: accepted Disputed bug is accepted as valid or Feature accepted as desired to be added. type: bug Something doesn't work as it was intended to. and removed resolution: awaiting response Additional information is required from the issue reporter labels Sep 25, 2024
@papermc-projects papermc-projects bot moved this to ✅ Accepted in Issues: Bugs Sep 25, 2024
@Machine-Maker
Copy link
Member

After for research, this might not be a Paper issue, but rather a plugin just removing an entity in the wrong place. Basically non-player entities are destroyed and recreated when they change dimensions. As part of the changing dimensions process, before they are removed, all their passengers (in this case the player) are dismounted. This fires the EntityDismountEvent. If in the handler for the dismount event, you remove the entity, then the entity's scheduler is retired. But the entity isn't actually being completely removed, and the CraftEntity wrapper is transferred over to the new nms Entity (and that keeps the now retired scheduler) which then causes this exception/crash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: accepted Disputed bug is accepted as valid or Feature accepted as desired to be added. type: bug Something doesn't work as it was intended to. version: 1.21.1 Game version 1.21.1
Projects
Status: ✅ Accepted
Development

No branches or pull requests

2 participants