TransWikia.com

NoAi Chicken won't activate pressure plate

Arqade Asked on November 3, 2021

I need help creating a device that sends "NoAI:1b" chickens over pressure plates to make music. Unfortunately, either the chickens are not technically touching the ground or some how the lack of AI really messes things up (or something else).

The chickens are teleported along a track that sends them over the pressure plate shown here:

And here are the codes to teleport the chicken forward, back to the beginning of the track, and to summon them. Respectively.

execute as @e[type=chicken,distance=..33.5] at @e[type=chicken,distance=..33.5] run tp @s[distance=..0.5,type=chicken] ~ ~ ~.25

execute as @e[type=chicken,name=nC] at @e[type=chicken,name=nC] if block ~ ~-2 ~ minecraft:repeating_command_block run tp @s[distance=..0.5,type=chicken] ~ ~ ~-31

summon minecraft:chicken 654 65 316 {CustomName:""mC"",CustomNameVisible:1,Health:100,Attributes:[{Name:"generic.maxHealth",Base:100},{Name:"generic.knockbackResistance",Base:1f}],Silent:1,NoAI:1,OnGround:1b}

Any suggestions, tips, or recommendations on the script would be helpful. And I will be willing to answer questions about the design.

2 Answers

You could use tripwire and string. NoAI chickens still activate that.

Answered by Fabian Röling on November 3, 2021

It's because the chicken is not affected by gravity, so removing the NoAI tag will help out. The OnGround tag is redundant as well. However, the chicken will still be able to move and lay eggs, which may mess stuff up. Here's how you can fix both things:

You can utilize the Movement Speed attribute to force the chicken to stand still, like so:

Attributes:[{Name:generic.movement_speed,Base:0}]

Additionally, chickens have a special attribute involving how long until their next egg is laid. Set it to a very high number within your summon command:

EggLayTime:99999

You may need to reset this timer occasionally.

Your final /summon command should look like this:

summon minecraft:chicken 654 65 316 {CustomName:""mC"",CustomNameVisible:1,Health:100,Attributes:[{Name:"generic.maxHealth",Base:100},{Name:"generic.knockbackResistance",Base:1f},{Name:generic.movement_speed,Base:0}],Silent:1,EggLayTime:99999}

The other commands should work fine.

Answered by Sam Hill on November 3, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP