#Trying to make Iron Golems reselect targets so they don't overwhelmed by hordes

1 messages · Page 1 of 1 (latest)

calm flame
#

I'm currently reworking the iron golem but I don't know which components is causing iron golems to force golems to walk towards monsters they knock into the backline. I'm as stuck as this golem trying to get past this horde... Help!!

idle kraken
#

add "reselect_targets": true, to the minecraft:behavior.nearest_attackable_target component

calm flame
#

ooh i'm gonna try

sonic mango
calm flame
#

this SHOULD be it

calm flame
idle kraken
calm flame
#

i googled it

#

i just need to also add that too and...

#

i guess i can put in a number

#

an interval of how many ticks until the golem reselects a target

#

okay

#

nope... still doesn't work

#

the golem still gets swarmed

#

i'm starting to hate how they're so easily pushed too

#

i wonder if i can at least disable being pushed by other entities

idle kraken
#

you could make an aoe attack that pushes all other mobs away from the golem when it swings

#

it would be pretty easy with scripting, but it would be a bit of a weird workaround

echo ledge
#

remove it lol

#

basically its like a cool down

echo ledge
calm flame
#

i'm sure there's another way

echo ledge
calm flame
#

oh do tell!

echo ledge
#

minecraft:pushable

calm flame
#

ohh...

#

okay! so i just add that in and set it to false

echo ledge
#

yeah

#

you can make the iron golem pushable by pistons, or not.

#

its up to you

#

also

#

pushable by other mobs.

calm flame
#

oh yay!

#

now they're really gonna be juggernauts

echo ledge
calm flame
#

still gotta work out the target reselection

echo ledge
#

when you blocked them with a shield

#

they do a roar that knocks you back.

calm flame
#

oh yeah they do that!

#

i could make them do that too??

echo ledge
calm flame
#

oh my god that is amazing!

calm flame
echo ledge
#

yea

calm flame
#

how would i make it work tho

echo ledge
calm flame
#

golem just does it randomly?

echo ledge
#

maybe using an event

echo ledge
#

only when it suceeds to do its swinging attack.

calm flame
calm flame
echo ledge
#

sure

calm flame
#

thank you for the ideas and workarounds

#

i got something to do when i get home

echo ledge
#

i just made it

#

i mean my own rendition

#

wanna see?

#

lol

#

i didn't used scripts to do this btw

calm flame
#

i love it!

echo ledge
#

yeah lol

calm flame
#

is the blast configurable?

echo ledge
calm flame
#

like the knockback power

#

sweet

echo ledge
#

i used an invisible entity with the knockback roar

#

lol

#

wait let me send the jsons if u wanna test em.

calm flame
#

yes please

echo ledge
calm flame
echo ledge
#

here

calm flame
#

thanks!

echo ledge
calm flame
#

the invisible entity

#

or does it get summoned to perform the action then despawns after?

echo ledge
#

oh and also, put this in the folder named "particles" in your addon's resource pack.

it hides the particles of the knockback.

echo ledge
#

it only spawns when the golem attacks.

#

it despawns right after

calm flame
#

good to know!

#

will nothing funky happen if several iron golems are fighting?

calm flame
#

alr

echo ledge
#

i made them immune to the blast.

#

lol

#

other mobs aren't

#

including players

calm flame
#

oh so we get pummeled into the air too

echo ledge
#

yup

#

hehe

calm flame
#

that's hilarious. i'm keeping it

echo ledge
#

you get knocked into the air and then get knocked backwards

#

haha

#

i only made the damage deal up to 10 hearts.

calm flame
echo ledge
calm flame
#

something like 1-3 is fine

echo ledge
#

well since its configurable you can reduce the number.

calm flame
#

could i configure how often the roar occurs each hit?

#

like, say, a 33% chance it's performed

echo ledge
calm flame
# echo ledge

i assume i have to put the invisible entity into the same entity folder as with the iron golem

calm flame
#

thank you thank you

calm flame
# echo ledge

im not sure what i did wrong... golem's barely attacking

#

like it wants to be REALLY close to the zombie it's targetting, this is nuts

calm flame
#

i dont know

#

i just replaced minecraft:melee_attack with yourminecraft:melee_box_attack line

#

OH WAIT

#

it might have to do with the attack_interval

#

i just removed it

calm flame
#

did i make it too weak by setting everything to 2?

#

AHH I FORGOT TO ADD THE EVENT ITSELF

echo ledge
#

yeah

echo ledge
#

💀

calm flame
#

ok i added it

echo ledge
#

lol

#

alr

calm flame
calm flame
#

i gave it 250 health from 100

#

i made it possible to feed them iron blocks

#

which heals them 10x of what ingots do

#

i also made it possible too with iron nuggets

echo ledge
#

i see

#

crazy

calm flame
#

it's supposed to heal 2.5

#

but from my testing, it's rounded down to 2

echo ledge
#

bruh

#

i mean

#

thats good enough right?

calm flame
#

i guess health_amount only wants whole numbers, which, fine

#

i also wanna math out other iron based items

#

like uhh

#

iron bars

calm flame
#

6: 25 150=16:?

#

400 2400/6

#

something around 66 actually 400

#

and split that across 16 iron bars..

#

okay

#

iron bars only healing 4hp does not

#

hold on

#

25??

#

wait i'm not even supposed to use ratios to begin with

#

i just need to divide 150 by 16

#

and then round it down

calm flame
echo ledge
#

yeah

#

i guess

calm flame
#

sorry for the fucked up xbox audio

#

BUT YAY IT WORKS

echo ledge
#

nice

#

oh ur on xbox

#

crazy.

echo ledge
calm flame
#

yup

#

i just have the free version

#

saving up for the marketplace one

echo ledge
#

i see

sonic mango
echo ledge
indigo vapor
#

Ohh all of em

echo ledge
#

lmao

#

no.

indigo vapor
#

Ohh okay

#

This will come in handy, thanks bro

echo ledge
#

np

prime vault
#

Just to add little more detail

#

And also, you could make the knockback inside the iron golem, it'll automatically ignore themself

#

Additionally you can add ignore type and family too so it'll not knockback villager or other iron golem

#

And instead of knockback when attacking, you can trigger it randomly after it takes damage