-
Bug
-
Resolution: Unresolved
-
None
-
Minecraft 15w36c, Minecraft 15w36d, Minecraft 15w39c, Minecraft 15w40a, Minecraft 15w40b, Minecraft 15w41b, Minecraft 15w42a, Minecraft 15w47c, Minecraft 15w50a, Minecraft 16w02a, Minecraft 16w07b, Minecraft 1.9.1 Pre-Release 3, Minecraft 16w35a, Minecraft 16w36a, Minecraft 1.11, Minecraft 1.11.2, Minecraft 1.12 Pre-Release 6, Minecraft 18w03b, Minecraft 18w19b, Minecraft 1.13.1, 1.14.4, 1.15.2, 20w07a, 1.16.1, 1.16.4, 21w05b, 1.17.1, 21w43a, 1.19.4, 1.20.1, 1.21 Pre-Release 4
-
Confirmed
-
Commands
-
Low
-
Platform
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
-
MC-88005 Teams - Player Collision
- Resolved
-
MC-88052 Cullision Disable feature
- Resolved
-
MC-94254 Collision rule flipped
- Resolved
-
MC-124587 team Collision Rules not working
- Resolved
-
MC-129469 /team bug
- Resolved
-
MC-192543 "pushOwnTeam" and "pushOtherTeams" team collisionRule swapped
- Resolved
-
MC-240125 Team collisionRules
- Resolved
- relates to
-
MC-124092 Some team options don't work
- Resolved