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

Collidable #11440

Open
Jakush opened this issue Sep 26, 2024 · 2 comments
Open

Collidable #11440

Jakush opened this issue Sep 26, 2024 · 2 comments
Labels
status: needs triage type: bug Something doesn't work as it was intended to. version: 1.21.1

Comments

@Jakush
Copy link

Jakush commented Sep 26, 2024

Expected behavior

Using LivingEntity#setCollidable(boolean) should disable or enable collisions with the living entity.

Observed/Actual behavior

When setting collidable to false on Player, it collides with another entity no matter if it is set to false or true.

Steps/models to reproduce

  1. Spawn entity or obtain entity instance
  2. Get player instance
  3. Use setCollidable(false) on the player
  4. Collide with the entity :)

Plugin and Datapack List

[16:52:55 INFO]: Server Plugins (4):
[16:52:55 INFO]: Bukkit Plugins:
[16:52:55 INFO]: - FastAsyncWorldEdit, Multiverse-Core, ServerFramework, VoidGen

Paper version

[16:53:13 INFO]: Checking version, please wait...
[16:53:14 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-98-9b1ee0d (MC: 1.21.1)

Other

I was doing this when command is issued using Brigadier, though I don't think that could cause any issues.

@Jakush Jakush added status: needs triage type: bug Something doesn't work as it was intended to. labels Sep 26, 2024
@electronicboy
Copy link
Member

if you only set it on the player, this is the expected behavior because collisions work both ways

@Jakush
Copy link
Author

Jakush commented Sep 26, 2024

I have this logic which you say, should work:

Player player = context.getArgument("player", PlayerSelectorArgumentResolver.class).resolve(context.getSource()).getFirst();
disguiseManager.disguiseAsEntity(player, entityType.getEntityClass(), entity -> {
    player.getCollidableExemptions().add(entity.getUniqueId());
    if (entity instanceof LivingEntity livingEntity) {
        livingEntity.setAI(false);
        livingEntity.getCollidableExemptions().add(player.getUniqueId());
    }
});

However this does not work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage type: bug Something doesn't work as it was intended to. version: 1.21.1
Projects
Status: 🕑 Needs Triage
Development

No branches or pull requests

2 participants