#(mrhoneybun) how to make a primed tnt spawn whenever a zombie is chasing after the player
26 messages · Page 1 of 1 (latest)
(mrhoneybun) how to make a primed tnt spawn whenever a zombie is chasing after the player
Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
You can block this bot if you don't want to see these messages, I won't mind.
<@&525394568410038282>
type: item
material: zombie_spawn_egg
display name: <&c>Bomber
lore:
- <&7>Spawn a bomber
getbomberspawnegg:
type: command
name: getbomberspawnegg
description: Gives the player a bomber spawn egg
usage: /getbomberspawnegg
script:
- give bomberspawnegg
bomber:
type: entity
entity_type: zombie
mechanisms:
max_health: 100
health: 100
equipment:
boots: air
leggings: air
chestplate: air
helmet: TNT
item_in_hand: FLINT_AND_STEEL
age: baby
custom_name: <&c>Bomber
custom_name_visible: true
spawnbomber:
type: world
events:
on player right clicks block:
- determine passively cancelled
- spawn bomber <context.relative>
on bomber targets player:
- while <context.target.is_living>:
- spawn primed_tnt <context.entity.location>
- ratelimit <context.entity> 5s```
but sometimes the zombie will spawn one or two tnts, and i want it to spawn the primed tnt consistently, so im assuming my code is wrong somewhere
ratelimit should come before the code being ratelimited
should also check if the context entity is spawned / exists to prevent errors when chunk gets unloaded
!t entity.is_living
Returns whether the entity type is a living-type entity (eg a cow or a player or anything else that lives, as specifically opposed to non-living entities like paintings, etc).
Not to be confused with the idea of being alive - see !tag EntityTag.is_spawned.
data
ElementTag(Boolean)
i would go with a flag on the zombie rather than relying on a ratelimit
I'm not sure what the ratelimit is for
I uhh
think it's putting a delay on the loop somehow?
not sure how it's doing that tbh
i.e there's no wait on the loop
doesnt make sense at all inside the loop, it would only run once?
so it should in theory be spawning infinite tnts, but that's not what it's doing
yeah maybe
anyway, it's not how this should be tackled to begin with
afaik, a ratelimit at the end of code won't do anything
ratelimit the event would make sense but would still start infinite while loops every 5 seconds
use a flag when you dont want this
!solved