K-Turrets

K-Turrets

3M Downloads

Turrets don't attack players on 1.16.5

AlexiyOrlov opened this issue ยท 6 comments

commented

I need someone to help me fix this issue

commented

No, turns out it was a silly mistake in the code that caused inability to set turrets to target players. Fixed

commented

Definitely not fixed. My alt, CraftingGradius, cannot be attacked by this turret, made by KaleidioPlays, after I set it to defend from alien players, and reset its target list to all entities.

And yes, I did update to 0.1.34
2024-08-28_00 22 09

commented

List<EntityType<?>> targets = ForgeRegistries.ENTITIES.getValues().stream().filter(entityType1 -> !entityType1.getCategory().isFriendly()).collect(Collectors.toList());

Pretty sure the forge registry for this is at fault, for the lambda you are using is more than likely filtering out player entities.

I recommend just manually shoving players in after you've pulled that data, because you already expose a separate control for "targeting alien players" anyway, so really, people using turrets should not be expected to add minecraft:players to the list.

It should also be safe to just add the EntityType of player to that list by default anyway, since no mods ever change that id.

commented

I highly suggest reopening this issue and taking another look, as it is still definitely not fixed, no matter my testing.

I also suggest your testing include running a dedicated server (not opening to LAN) and use an alternate account.

commented

The problem is it works for me

commented

I understand that, but I assure you, it's definitely not working. If you need, I will open a new issue for it and send video footage of the problem persisting.