Create

Create

86M Downloads

Deployers set to attack mode will anger mobs regardless of Ignore Deployer Attacks config.

tyreforhyred opened this issue ยท 9 comments

commented

Describe the Bug

Deployers set to attack mode will anger mobs regardless of Ignore Deployer Attacks config. This occurs in easy, normal and hard difficulties.

Reproduction Steps

set a deployer to attack mode
watch as it hits a hostile mob and angers it, receiving retaliation (arrows, explosions, etc)

Expected Result

for it to respect the config

Screenshots and Videos

No response

Crash Report or Log

No response

Operating System

windows 10

Mod Version

0.5.1f

Minecraft Version

1.20.1

Forge Version

47.2.6

Other Mods

no other mods other than crate were installed in this instance. it also occurs with neoforge version 47.1.79

Additional Context

No response

commented

that's interesting. as if line of sight was blocked.

commented

When placing trapdoors 1 block in front of the deployers and closing them, mobs no longer get angry

commented

I'm having the same issue. Using forge 47.2.0 with Minecraft 1.20.1 java edition. Using create 0.5.1.e.
It occurs in single player and on a server. Other config settings (like belt length) do work.

commented

Yeah, but placing solid blocks right in front of the deployers doesn't do this.

commented

So i fixed it. In the deployer fake player class i modified the code:
@SubscribeEvent
public static void entitiesDontRetaliate(LivingChangeTargetEvent event) {
if (!(event.getNewTarget() instanceof DeployerFakePlayer))
return;
LivingEntity entityLiving = event.getEntity();
if (!(entityLiving instanceof Mob))
return;
Mob mob = (Mob) entityLiving;

	if(!(mob instanceof Monster))
		return;
	
	Monster monster = (Monster) mob;
	CKinetics.DeployerAggroSetting setting = AllConfigs.server().kinetics.ignoreDeployerAttacks.get();
	
	switch (setting) {
	case ALL:
		event.setCanceled(true); //first was mob.setTarget(null);
		break;
	case CREEPERS:
		if (monster instanceof Creeper) {
			event.setCanceled(true); //first was mob.setTarget(null);
		}
		break;
	case NONE:
		break;
	default:
		break;
	}
}

Apparently the setTarget(null) does not do enything (see implementation in superclass). Canceling the event however, works!

commented

+1 I am also seeing this bug. With MC1.20.1, Forge 47.2.0, Create 0.5.1.f

commented

+1 I am also seeing this bug. With MC1.20.1, Forge 47.2.0, Create 0.5.1.f

Exactly the same versions, same problem..

commented

Confirmed on fabric aswell, will work on a PR to resolve this

commented