1

Trying to keep a pig in place but failing... need help (datapack)

Cra-Zy 6/20/20 2:42 pm history
110

Problem:


I summoned a pig that is silent and has NoAi, yet the pig very slowly moves in a North-West direction.

Solution?


I need a command that keeps the pig positioned in its current state.
Or. find out what causes the movement and fix it.


so, i'm trying to create a datapack, in this datapack i want chairs, i decided to make my own but inspired by the Tables & Chairs datapack.

I summon an endermite with a specific tag, the endermite dies straight away but in its place it spawns an Armor_stand with the custom model, and a pig, so the chair is functional.

The pig gets spawned as baby, invisible, and with a saddle, this pig is supposed to be static and without Ai, yet i find this:
https://prnt.sc/t3fhod (Invisible Pigs slowly going in a North-west Direction.

Pig Placing code:
execute at @a[​scores={prot=1}] run execute at @e[​tag=chair] align xyz run summon pig ~0.5 ~0.2 ~0.5 {Tags:[​pchair],NoGravity:1b,Silent:1b,NoAI:1b,Age:-999999,Rotation:[​270f],Saddle:1b,ActiveEffects:[{Id:11,Amplifier:100,Duration:999999,ShowParticles:0b},{Id:14b,Amplifier:1b,Duration:19999980,ShowParticles:0b}],Attributes:[{Name:generic.maxHealth,Base:1}],Health:1}



"prot1" is the player rotation score, this indicates what way the pig is facing.
"chair" is the tag of an endermite. which kills itself when placed.



execute as @e[​type=pig,tag=pchair] at @s if entity @p[​distance=0..5] run data merge entity @s {Age:-2000000000,ActiveEffects:[{Id:11,Amplifier:100,Duration:999999,ShowParticles:0b}]}

This command keeps the pig as baby.

There are no other commands that involve the pig.

My Question for you guys:



So, theres something that makes this pig move, i cant find out what causes it, the code looks clean of movement to me. i tried looking for a teleportation command that can tp the pig to its armorstand, but it needs to be below the armorstand so simply teleporting it doesnt work. and there are multiple pigs and armorstands.

Is there a teleportation command that can teleport the pig to the nearest armorstand (and changeable rotation/y-position)? or is there something wrong with my code?

Tp commands i tried:
/execute as @e[type=minecraft:armor_stand,tag=rcchair] run tp @e[type=pig,tag=pchair,limit=1,distance=..1] @s[distance=..1]
/execute at @e[type=pig,tag=pchair] run tp @e[type=pig,tag=pchair,limit=1,distance=..1] @e[type=armor_stand,limit=1,sort=nearest,distance=0..1]




I'm sorry if this is a bit unclear, i dont fully get it either, but if someone could help me, that would be great!

Thanks in advance
Posted by
Cra-Zy
Level 22 : Expert Architect
12

  Have something to say?

JoinSign in

Welcome