teams option <team> collisionRule values are not working correctly
The bug
Values for the team option collisionRule are not working correctly.
With the current behaviour for example two entities in different teams with pushOwnTeam as collision rule push each other back.
How to reproduce
- /team add Team1
- /team modify Team1 collisionRule pushOtherTeams
- /team add Team2
- /team join Team1
- /summon cow ~ ~ ~ {Team:"Team2",Health:0.1f}
It just acts as it was set to pushOwnTeam and you cannot push the cow
- /team add Team1
- /team modify Team1 collisionRule pushOwnTeam
- /team add Team2
- /team join Team1
- /summon cow ~ ~ ~ {Team:"Team2",Health:0.1f}
It just acts as it was set to pushOtherTeam and you can push the cow
The reason
The following is based on decompiled version of Minecraft 1.9 using MCP 9.24 beta. All method and class names are the names used in the decompiled version.
The reason why this happens is because the predicate net.minecraft.util.EntitySelectors.func_188442_a().new Predicate() {...}.() returns false if two entities are in the same team and one of them can only push teammates.
public static <T extends Entity> Predicate<T> func_188442_a(final Entity p_188442_0_) { final Team team = p_188442_0_.getTeam(); final Team.CollisionRule team$collisionrule = team == null ? Team.CollisionRule.ALWAYS : team.getCollisionRule(); Predicate<?> ret = team$collisionrule == Team.CollisionRule.NEVER ? Predicates.alwaysFalse() : Predicates.and(NOT_SPECTATING, new Predicate<Entity>() { public boolean apply(Entity p_apply_1_) { if (!p_apply_1_.canBePushed()) { return false; } else if (!p_188442_0_.worldObj.isRemote || p_apply_1_ instanceof EntityPlayer && ((EntityPlayer)p_apply_1_).isUser()) { Team team1 = p_apply_1_.getTeam(); Team.CollisionRule team$collisionrule1 = team1 == null ? Team.CollisionRule.ALWAYS : team1.getCollisionRule(); if (team$collisionrule1 == Team.CollisionRule.NEVER) { return false; } // Replaced this /* Parameter explanation: * p_188442_0_ = Entity that gets pushed * p_apply_1_ = Entity that pushes */ /* * Team.CollisionRule values: * ALWAYS("always", 0), * NEVER("never", 1), * HIDE_FOR_OTHER_TEAMS("pushOtherTeams", 2), * HIDE_FOR_OWN_TEAM("pushOwnTeam", 3); */ //else //{ // boolean flag = team != null && team.isSameTeam(team1); //return (team$collisionrule == Team.CollisionRule.HIDE_FOR_OWN_TEAM || team$collisionrule1 == Team.CollisionRule.HIDE_FOR_OWN_TEAM) && flag ? false : team$collisionrule != Team.CollisionRule.HIDE_FOR_OTHER_TEAMS && team$collisionrule1 != Team.CollisionRule.HIDE_FOR_OTHER_TEAMS || flag; //} else if (team$collisionrule == Team.CollisionRule.ALWAYS && team$collisionrule1 == Team.CollisionRule.ALWAYS) { return true; } else { boolean sameTeam = team != null && team.isSameTeam(team1); return ((sameTeam && team$collisionrule == Team.CollisionRule.HIDE_FOR_OWN_TEAM) || (!sameTeam && team$collisionrule != Team.CollisionRule.HIDE_FOR_OWN_TEAM && team$collisionrule1 != Team.CollisionRule.HIDE_FOR_OWN_TEAM)); } } else { return false; } } }); return (Predicate<T>)ret; }
This should fix this bug, but please recheck.
Note: The problem is that an entity does not only push another entity, it pushes back itself as well. This means that for both entities the collision rule has to allow pushing the other entity.
Linked Issues
is duplicated by7
relates to1
Created Issue:
teams option <team> collisionRule pushOtherTeams not working for mobs
teams option <team> collisionRule pushOtherTeamsnot working for mobsteams option <team> collisionRule pushOtherTeams and pushOwnTeam are interchanged
How to reproduce
- /scoreboard teams add Team1
- /scoreboard teams option Team1 collisionRule pushOtherTeams
- /scoreboard teams add Team2
- /scoreboard teams join Team1
- /summon Cow ~ ~ ~ {Team:"Team2",Health:0.1}
It just acts as it was set to never and you cannot push the cow
- /scoreboard teams add Team1
- /scoreboard teams option Team1 collisionRule pushOtherTeams
- /scoreboard teams add Team2
- /scoreboard teams join Team1
- /summon Cow ~ ~ ~ {Team:"Team2",Health:0.1}
It just acts as it was set to never and you cannot push the cow
How to reproduce
- /scoreboard teams add Team1
- /scoreboard teams option Team1 collisionRule pushOtherTeams
- /scoreboard teams add Team2
- /scoreboard teams join Team1
- /summon Cow ~ ~ ~ {Team:"Team2",Health:0.1}
It just acts as it was set to never and you cannot push the cow
- /scoreboard teams add Team1
- /scoreboard teams option Team1 collisionRule pushO
therTeams- /scoreboard teams add Team2
- /scoreboard teams join Team1
- /summon Cow ~ ~ ~ {Team:"Team2",Health:0.1}
It just acts as it was set to
neverand you cannotpush the cowHow to reproduce
- /scoreboard teams add Team1
- /scoreboard teams option Team1 collisionRule pushOtherTeams
- /scoreboard teams add Team2
- /scoreboard teams join Team1
- /summon Cow ~ ~ ~ {Team:"Team2",Health:0.1}
It just acts as it was set to pushOwnTeam and you cannot push the cow
- /scoreboard teams add Team1
- /scoreboard teams option Team1 collisionRule pushOwnTeam
- /scoreboard teams add Team2
- /scoreboard teams join Team1
- /summon Cow ~ ~ ~ {Team:"Team2",Health:0.1}
It just acts as it was set to pushOtherTeam and you can push the cow
is duplicated by
is duplicated by
How to reproduce
- /scoreboard teams add Team1
- /scoreboard teams option Team1 collisionRule pushOtherTeams
- /scoreboard teams add Team2
- /scoreboard teams join Team1
- /summon Cow ~ ~ ~ {Team:"Team2",Health:0.1f}
It just acts as it was set to pushOwnTeam and you cannot push the cow
- /scoreboard teams add Team1
- /scoreboard teams option Team1 collisionRule pushOwnTeam
- /scoreboard teams add Team2
- /scoreboard teams join Team1
- /summon Cow ~ ~ ~ {Team:"Team2",Health:0.1f}
It just acts as it was set to pushOtherTeam and you can push the cow
is duplicated by
A comment with security level 'global-moderators' was removed.
How to reproduce
- /scoreboard teams add Team1
- /scoreboard teams option Team1 collisionRule pushOtherTeams
- /scoreboard teams add Team2
- /scoreboard teams join Team1
- /summon Cow ~ ~ ~ {Team:"Team2",Health:0.1f}
It just acts as it was set to pushOwnTeam and you cannot push the cow
- /scoreboard teams add Team1
- /scoreboard teams option Team1 collisionRule pushOwnTeam
- /scoreboard teams add Team2
- /scoreboard teams join Team1
- /summon Cow ~ ~ ~ {Team:"Team2",Health:0.1f}
It just acts as it was set to pushOtherTeam and you can push the cow
The bug
Values for the team option collisionRule are not working correctly.
With the current behaviour for example two entities in different teams with pushOwnTeam as collision rule push each other back.How to reproduce
- /scoreboard teams add Team1
- /scoreboard teams option Team1 collisionRule pushOtherTeams
- /scoreboard teams add Team2
- /scoreboard teams join Team1
- /summon Cow ~ ~ ~ {Team:"Team2",Health:0.1f}
It just acts as it was set to pushOwnTeam and you cannot push the cow
- /scoreboard teams add Team1
- /scoreboard teams option Team1 collisionRule pushOwnTeam
- /scoreboard teams add Team2
- /scoreboard teams join Team1
- /summon Cow ~ ~ ~ {Team:"Team2",Health:0.1f}
It just acts as it was set to pushOtherTeam and you can push the cow
The reason
The following is based on decompiled version of Minecraft 1.9 using MCP 9.24 beta. All method and class names are the names used in the decompiled version.
The reason why this happens is because the predicate net.minecraft.util.EntitySelectors.func_188442_a().new Predicate() {...}.() returns false if two entities are in the same team and one of them can only push teammates.
public static <T extends Entity> Predicate<T> func_188442_a(final Entity p_188442_0_) { final Team team = p_188442_0_.getTeam(); final Team.CollisionRule team$collisionrule = team == null ? Team.CollisionRule.ALWAYS : team.getCollisionRule(); Predicate<?> ret = team$collisionrule == Team.CollisionRule.NEVER ? Predicates.alwaysFalse() : Predicates.and(NOT_SPECTATING, new Predicate<Entity>() { public boolean apply(Entity p_apply_1_) { if (!p_apply_1_.canBePushed()) { return false; } else if (!p_188442_0_.worldObj.isRemote || p_apply_1_ instanceof EntityPlayer && ((EntityPlayer)p_apply_1_).isUser()) { Team team1 = p_apply_1_.getTeam(); Team.CollisionRule team$collisionrule1 = team1 == null ? Team.CollisionRule.ALWAYS : team1.getCollisionRule(); if (team$collisionrule1 == Team.CollisionRule.NEVER) { return false; } // Replaced this /* Parameter explanation: * p_188442_0_ = Entity that gets pushed * p_apply_1_ = Entity that pushes */ /* * Team.CollisionRule values: * ALWAYS("always", 0), * NEVER("never", 1), * HIDE_FOR_OTHER_TEAMS("pushOtherTeams", 2), * HIDE_FOR_OWN_TEAM("pushOwnTeam", 3); */ //else //{ // boolean flag = team != null && team.isSameTeam(team1); //return (team$collisionrule == Team.CollisionRule.HIDE_FOR_OWN_TEAM || team$collisionrule1 == Team.CollisionRule.HIDE_FOR_OWN_TEAM) && flag ? false : team$collisionrule != Team.CollisionRule.HIDE_FOR_OTHER_TEAMS && team$collisionrule1 != Team.CollisionRule.HIDE_FOR_OTHER_TEAMS || flag; //} else if (team$collisionrule == Team.CollisionRule.ALWAYS && team$collisionrule1 == Team.CollisionRule.ALWAYS) { return true; } else { boolean sameTeam = team != null && team.isSameTeam(team1); return ((sameTeam && team$collisionrule == Team.CollisionRule.HIDE_FOR_OWN_TEAM) || (!sameTeam && team$collisionrule != Team.CollisionRule.HIDE_FOR_OWN_TEAM && team$collisionrule1 != Team.CollisionRule.HIDE_FOR_OWN_TEAM)); } } else { return false; } } }); return (Predicate<T>)ret; }This should fix this bug, but please recheck.
Note: The problem is that an entity does not only push another entity, it pushes back itself as well. This means that for both entities the collision rule has to allow pushing the other entity.
teams option <team> collisionRulepushOtherTeams and pushOwnTeam are interchangedteams option <team> collisionRule values are not working correctly
relates to
is duplicated by
is duplicated by
The bug
Values for the team option collisionRule are not working correctly.
With the current behaviour for example two entities in different teams with pushOwnTeam as collision rule push each other back.How to reproduce
- /
scoreboardteamsadd Team1- /
scoreboard teams optionTeam1 collisionRule pushOtherTeams- /
scoreboardteamsadd Team2- /
scoreboardteamsjoin Team1- /summon
Cow ~ ~ ~ {Team:"Team2",Health:0.1f}It just acts as it was set to pushOwnTeam and you cannot push the cow
- /
scoreboardteamsadd Team1- /
scoreboard teams optionTeam1 collisionRule pushOwnTeam- /
scoreboardteamsadd Team2- /
scoreboardteamsjoin Team1- /summon
Cow ~ ~ ~ {Team:"Team2",Health:0.1f}It just acts as it was set to pushOtherTeam and you can push the cow
The reason
The following is based on decompiled version of Minecraft 1.9 using MCP 9.24 beta. All method and class names are the names used in the decompiled version.
The reason why this happens is because the predicate net.minecraft.util.EntitySelectors.func_188442_a().new Predicate() {...}.() returns false if two entities are in the same team and one of them can only push teammates.
public static <T extends Entity> Predicate<T> func_188442_a(final Entity p_188442_0_) { final Team team = p_188442_0_.getTeam(); final Team.CollisionRule team$collisionrule = team == null ? Team.CollisionRule.ALWAYS : team.getCollisionRule(); Predicate<?> ret = team$collisionrule == Team.CollisionRule.NEVER ? Predicates.alwaysFalse() : Predicates.and(NOT_SPECTATING, new Predicate<Entity>() { public boolean apply(Entity p_apply_1_) { if (!p_apply_1_.canBePushed()) { return false; } else if (!p_188442_0_.worldObj.isRemote || p_apply_1_ instanceof EntityPlayer && ((EntityPlayer)p_apply_1_).isUser()) { Team team1 = p_apply_1_.getTeam(); Team.CollisionRule team$collisionrule1 = team1 == null ? Team.CollisionRule.ALWAYS : team1.getCollisionRule(); if (team$collisionrule1 == Team.CollisionRule.NEVER) { return false; } // Replaced this /* Parameter explanation: * p_188442_0_ = Entity that gets pushed * p_apply_1_ = Entity that pushes */ /* * Team.CollisionRule values: * ALWAYS("always", 0), * NEVER("never", 1), * HIDE_FOR_OTHER_TEAMS("pushOtherTeams", 2), * HIDE_FOR_OWN_TEAM("pushOwnTeam", 3); */ //else //{ // boolean flag = team != null && team.isSameTeam(team1); //return (team$collisionrule == Team.CollisionRule.HIDE_FOR_OWN_TEAM || team$collisionrule1 == Team.CollisionRule.HIDE_FOR_OWN_TEAM) && flag ? false : team$collisionrule != Team.CollisionRule.HIDE_FOR_OTHER_TEAMS && team$collisionrule1 != Team.CollisionRule.HIDE_FOR_OTHER_TEAMS || flag; //} else if (team$collisionrule == Team.CollisionRule.ALWAYS && team$collisionrule1 == Team.CollisionRule.ALWAYS) { return true; } else { boolean sameTeam = team != null && team.isSameTeam(team1); return ((sameTeam && team$collisionrule == Team.CollisionRule.HIDE_FOR_OWN_TEAM) || (!sameTeam && team$collisionrule != Team.CollisionRule.HIDE_FOR_OWN_TEAM && team$collisionrule1 != Team.CollisionRule.HIDE_FOR_OWN_TEAM)); } } else { return false; } } }); return (Predicate<T>)ret; }This should fix this bug, but please recheck.
Note: The problem is that an entity does not only push another entity, it pushes back itself as well. This means that for both entities the collision rule has to allow pushing the other entity.
The bug
Values for the team option collisionRule are not working correctly.
With the current behaviour for example two entities in different teams with pushOwnTeam as collision rule push each other back.How to reproduce
- /team add Team1
- /team modify Team1 collisionRule pushOtherTeams
- /team add Team2
- /team join Team1
- /summon cow ~ ~ ~ {Team:"Team2",Health:0.1f}
It just acts as it was set to pushOwnTeam and you cannot push the cow
- /team add Team1
- /team modify Team1 collisionRule pushOwnTeam
- /team add Team2
- /team join Team1
- /summon cow ~ ~ ~ {Team:"Team2",Health:0.1f}
It just acts as it was set to pushOtherTeam and you can push the cow
The reason
The following is based on decompiled version of Minecraft 1.9 using MCP 9.24 beta. All method and class names are the names used in the decompiled version.
The reason why this happens is because the predicate net.minecraft.util.EntitySelectors.func_188442_a().new Predicate() {...}.() returns false if two entities are in the same team and one of them can only push teammates.
public static <T extends Entity> Predicate<T> func_188442_a(final Entity p_188442_0_) { final Team team = p_188442_0_.getTeam(); final Team.CollisionRule team$collisionrule = team == null ? Team.CollisionRule.ALWAYS : team.getCollisionRule(); Predicate<?> ret = team$collisionrule == Team.CollisionRule.NEVER ? Predicates.alwaysFalse() : Predicates.and(NOT_SPECTATING, new Predicate<Entity>() { public boolean apply(Entity p_apply_1_) { if (!p_apply_1_.canBePushed()) { return false; } else if (!p_188442_0_.worldObj.isRemote || p_apply_1_ instanceof EntityPlayer && ((EntityPlayer)p_apply_1_).isUser()) { Team team1 = p_apply_1_.getTeam(); Team.CollisionRule team$collisionrule1 = team1 == null ? Team.CollisionRule.ALWAYS : team1.getCollisionRule(); if (team$collisionrule1 == Team.CollisionRule.NEVER) { return false; } // Replaced this /* Parameter explanation: * p_188442_0_ = Entity that gets pushed * p_apply_1_ = Entity that pushes */ /* * Team.CollisionRule values: * ALWAYS("always", 0), * NEVER("never", 1), * HIDE_FOR_OTHER_TEAMS("pushOtherTeams", 2), * HIDE_FOR_OWN_TEAM("pushOwnTeam", 3); */ //else //{ // boolean flag = team != null && team.isSameTeam(team1); //return (team$collisionrule == Team.CollisionRule.HIDE_FOR_OWN_TEAM || team$collisionrule1 == Team.CollisionRule.HIDE_FOR_OWN_TEAM) && flag ? false : team$collisionrule != Team.CollisionRule.HIDE_FOR_OTHER_TEAMS && team$collisionrule1 != Team.CollisionRule.HIDE_FOR_OTHER_TEAMS || flag; //} else if (team$collisionrule == Team.CollisionRule.ALWAYS && team$collisionrule1 == Team.CollisionRule.ALWAYS) { return true; } else { boolean sameTeam = team != null && team.isSameTeam(team1); return ((sameTeam && team$collisionrule == Team.CollisionRule.HIDE_FOR_OWN_TEAM) || (!sameTeam && team$collisionrule != Team.CollisionRule.HIDE_FOR_OWN_TEAM && team$collisionrule1 != Team.CollisionRule.HIDE_FOR_OWN_TEAM)); } } else { return false; } } }); return (Predicate<T>)ret; }This should fix this bug, but please recheck.
Note: The problem is that an entity does not only push another entity, it pushes back itself as well. This means that for both entities the collision rule has to allow pushing the other entity.
is duplicated by
is duplicated by
Duplicates MC-87984
Thank you for your report!
However, we are already tracking this issue, and this report is a Duplicate of MC-87984, which is a report that has not been resolved yet.
If you want, you can upvote the parent ticket, and enable watching to receive any updates about it - if you believe you have any information that may be important for this issue, please leave a comment on the parent. Please also use the search function in the future to prevent duplicate reports.
Quick Links:
📓 Issue Guidelines – 🛠 Community Support – 📧 Customer Support – ✍️ Feedback and Suggestions – 📖 Game Wiki
💬 Mojira Subreddit – 💬 Mojira Discord
Thank you for your report!
We're actually already tracking this issue in MC-87984, so this ticket is being resolved and linked as a duplicate.
If you would like to add a vote or any additional information to the main ticket it would be appreciated.
Please be sure to use the search feature before creating a ticket to see if the issue has already been reported.
Quick Links:
📓 Issue Guidelines – 🛠 Community Support – 📧 Mojang Support – ✍️ Feedback and Suggestions – 💬 Mojira Discord
Confirmed for 15w40b
confirmed 15w41b
Confirmed for 15w42a
There are some weird issues when trying to push around things, not assigned to a team...
Confirmed for 16w02a.
still in 16w07b
A player in a team with collision disabled
(/scoreboard teams option a collisionRule pushOwnTeam)
will still be able to push teammates if riding a (horse) vehicle.
This seems to be a result of the client-sided logic of the player being pushed.
Kademlia that is very likely a different bug
This bug also occurs in 1.11. With collisionRule pushOtherTeams you push your own, with collisionRule pushOwnTeam you cant push.
Syntax was changed but this bug is still in 1.13.1.
Affects 1.14.4.
Bug is still present in 1.16.4
Can confirm in 21w05b.
+ 1.17.1-rc2
Affects 1.19.4
still in 1.20.1
Affects the current snapshot, 1.21 pre-release 4