@techman8817
  @techman8817
Techman88 | Pillager/Raid Lag Explanation and a Fix (Minecraft 1.14.4) @techman8817 | Uploaded 5 years ago | Updated 13 hours ago
The main lag seems to be caused by pillagers having a PatrolTarget set (an XYZ value), which they cannot reach, but continually try to pathfind through for example a mountain gap which causes laggy pathfinding all the time. This PatrolTarget is set on randomly spawned raids, the ones that rarely, and randomly occur anywhere.

This is the bug tracker issue bugs.mojang.com/browse/MC-157697
It's "fixed" but they won't release the fix until 1.15 if history says anything. They should make 1.14.5 with minor fixes like this.

My fix to the lag, just tells them not to patrol. You could just run this every few seconds in a command block, but I'll try to make a datapack.
/execute as @e[type=#minecraft:raiders] run data merge entity @s {Patrolling:0b}
May have some effect on raids on villages, in which the patrol leaders have Patrolling set to 1b. I did not test this with village-based raid farms, which may be affected.

I tried to simply remove PatrolTarget (which I believe is a good fix), but failed to find a working solution. Here's an attempt:
/execute as @e[type=#minecraft:raiders] run data remove entity @s PatrolTarget
It always resetted the PatrolTarget to 0,0,0 after running that, in all the variations I tried.

Also tried commands like this
/execute as @e[type=#minecraft:raiders] run data remove entity @s PatrolTarget.X
/execute as @e[type=#minecraft:raiders] run data remove entity @s PatrolTarget.Y
/execute as @e[type=#minecraft:raiders] run data remove entity @s PatrolTarget.Z
but it had the same effect, PatrolTarget would still be set to 0,0,0. I couldn't manage to simply remove the array. There might be a way to do this.


To summon a pillager that will cause lag:
/summon minecraft:pillager ~ ~ ~ {PatrolTarget:{X:5000,Y:0,Z:0},Patrolling:1}

A patrol leader copied from an actual random spawn (after hours of tick warp @ an ocean monument):
/summon minecraft:pillager ~ ~1 ~ {Brain: {memories: {}}, HurtByTimestamp: 0, CanJoinRaid: 1b, Attributes: [{Base: 24.0d, Name: "generic.maxHealth"}, {Base: 0.0d, Name: "generic.knockbackResistance"}, {Base: 0.3499999940395355d, Name: "generic.movementSpeed"}, {Base: 0.0d, Name: "generic.armor"}, {Base: 0.0d, Name: "generic.armorToughness"}, {Base: 32.0d, Modifiers: [{UUIDMost: 8155537058742812996L, UUIDLeast: -8989477423505343755L, Amount: 0.0798937026941346d, Operation: 1, Name: "Random spawn bonus"}], Name: "generic.followRange"}, {Base: 0.0d, Name: "generic.attackKnockback"}, {Base: 5.0d, Name: "generic.attackDamage"}], PatrolLeader: 1b, Invulnerable: 0b, FallFlying: 0b, PortalCooldown: 0, AbsorptionAmount: 0.0f, PatrolTarget: {X: 5000, Y: 70, Z: 0}, FallDistance: 0.0f, DeathTime: 0s, HandDropChances: [0.085f, 0.085f], PersistenceRequired: 0b, Patrolling: 1b, Motion: [0.006517125234045166d, -0.0784000015258789d, -0.01838171977574866d], Health: 24.0f, LeftHanded: 0b, Air: 300s, OnGround: 1b, Rotation: [190.26996f, -29.157398f], HandItems: [{id: "minecraft:crossbow", Count: 1b, tag: {Damage: 0}}, {}], Wave: 0, ArmorDropChances: [0.085f, 0.085f, 0.085f, 2.0f], Fire: -1s, ArmorItems: [{}, {}, {}, {id: "minecraft:white_banner", Count: 1b, tag: {BlockEntityTag: {Patterns: [{Pattern: "mr", Color: 9}, {Pattern: "bs", Color: 8}, {Pattern: "cs", Color: 7}, {Pattern: "bo", Color: 8}, {Pattern: "ms", Color: 15}, {Pattern: "hh", Color: 8}, {Pattern: "mc", Color: 8}, {Pattern: "bo", Color: 15}]}, display: {Name: '{"color":"gold","translate":"block.minecraft.ominous_banner"}'}}}], CanPickUpLoot: 1b, HurtTime: 0s, Inventory: []}

And a nonleader
/summon minecraft:pillager ~ ~1 ~ {Brain: {memories: {}}, HurtByTimestamp: 0, CanJoinRaid: 1b, Attributes: [{Base: 24.0d, Name: "generic.maxHealth"}, {Base: 0.0d, Name: "generic.knockbackResistance"}, {Base: 0.3499999940395355d, Name: "generic.movementSpeed"}, {Base: 0.0d, Name: "generic.armor"}, {Base: 0.0d, Name: "generic.armorToughness"}, {Base: 32.0d, Modifiers: [{UUIDMost: 1091068557595069214L, UUIDLeast: -5600343144297854598L, Amount: 0.032188637513724826d, Operation: 1, Name: "Random spawn bonus"}], Name: "generic.followRange"}, {Base: 0.0d, Name: "generic.attackKnockback"}, {Base: 5.0d, Name: "generic.attackDamage"}], PatrolLeader: 0b, Invulnerable: 0b, FallFlying: 0b, PortalCooldown: 0, AbsorptionAmount: 0.0f, PatrolTarget: {X: 5000, Y: 70, Z: 0}, FallDistance: 0.0f, DeathTime: 0s, HandDropChances: [0.085f, 0.085f], PersistenceRequired: 0b, Patrolling: 1b, Motion: [0.09824108023061612d, -0.0784000015258789d, 0.1033702431011876d], Health: 24.0f, LeftHanded: 0b, Air: 300s, OnGround: 1b, Rotation: [156.74881f, -15.138995f], HandItems: [{id: "minecraft:crossbow", Count: 1b, tag: {ChargedProjectiles: [{id: "minecraft:arrow", Count: 1b}], Charged: 1b, Damage: 0}}, {}], Wave: 0, ArmorDropChances: [0.085f, 0.085f, 0.085f, 0.085f], Fire: -1s, ArmorItems: [{}, {}, {}, {}], CanPickUpLoot: 1b, HurtTime: 0s, Inventory: []}
Pillager/Raid Lag Explanation and a Fix (Minecraft 1.14.4)Tutorial for Comet107s tunnel bore in 1.13.1 survival, for terracotta quarryImprovement to my Wither Skeleton Farm (20% faster) - instead of cobble walls, use glass+slabs315 blocks per TNT blast chamber; basic 1.13 item counter2x2 multi-floor mob elevator to turn a mob drop farm into an XP farm  Minecraft 1.13Selection sorting minecraft 1.12-1.8Easy way to make big holes to bedrock for slime farm etc (1.13.2 and maybe Spigot)Quartz Quarry / variable timer TNT duper flying machine (tested Minecraft 1.13.2)Simpler Terracotta Quarry TerraQuarry (1.13) (using 1.7.2 terrain gen)TerraQuarry finished, minecraft 1.13.1 but probably wait for 1.14 to use thisEasy, Humane Wither Skeleton Farm. NO slabbing, NO slimestone!  Minecraft 1.13.1Gold Crafting system for Zombie Pigman Farm, with tutorial

Pillager/Raid Lag Explanation and a Fix (Minecraft 1.14.4) @techman8817

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER