TransWikia.com

Teleporting a bat with a hopper using a data pack

Arqade Asked on August 18, 2021

I am trying to tp the bat when summoned to an item in radius 32 around you then to tp it again 1 down for the hopper to pick it up, then bring it back to me and to kill the 2 entities to get the items.
This is what I have so far:

execute at @p run summon bat ~ ~ {Silent:1b,Invulnerable:1b,Leashed:0b,PersistenceRequired:0b,NoAI:1b,Health:3f,BatFlags:0b,Tags:["drone"],Passengers:[{id:"minecraft:hopper_minecart",LootTable:"1",Tags:["drone"]}],ArmorItems:[{},{},{},{id:"minecraft:flint",Count:1b,tag:{CustomModelData:drone}}],ArmorDropChances:[0.085F,0.085F,0.085F,0.000F],ActiveEffects:[{Id:14b,Amplifier:1b,Duration:1000000000,ShowParticles:0b}],Attributes:[{Name:generic.max_health,Base:3}]}
execute at @p run teleport @e[type=minecraft:bat,tag=drone,limit=1] @e[type=item,distance=..32,limit=1]
execute at @e[type=item,] run teleport @e[type=bat,tag=drone,distance=..1] ~ ~-1 ~
execute at @p run teleport @e[type=bat,tag=drone] ~ ~ ~

The problem is that it only works when I do it my self one after the other not when a datapack does it.
I appreciate any help.

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