#(Doxa) Hitting entities ( Checking hit )
1 messages · Page 1 of 1 (latest)
(Doxa) Hitting entities ( Checking hit )
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>
an invisible armorstand if that changes anything btw
!event entity damaged
Entity
<entity> damaged by <entity> <entity> damaged (by <cause>) <entity> damages <entity>
with:<item> to only process the event when the item used to cause damage (in the damager's hand) is a specified item.
type:<entity> to only run if the entity damaged matches the entity input.
when an entity is damaged.
when the damager or damaged entity is a player. Cannot be both. - this adds switches flagged:<flag name> + permission:<node>, in addition to the <player> link.
when the damager or damaged entity is an NPC. Cannot be both.
<context.entity> returns the EntityTag that was damaged.
<context.damager> returns the EntityTag damaging the other entity, if any.
<context.cause> returns an ElementTag of reason the entity was damaged - see !language damage cause for causes.
<context.damage> returns an ElementTag(Decimal) of the amount of damage dealt.
<context.final_damage> returns an ElementTag(Decimal) of the amount of damage dealt, after armor is calculated.
<context.projectile> returns a EntityTag of the projectile, if one caused the event.
<context.damage_type_map> returns a MapTag the damage dealt by a specific damage type with keys: B...
<context.was_critical> returns 'true' if the damage was a critical hit. (Warning: this value is ca...
ElementTag(Decimal) to set the amount of damage the entity receives.
"CLEAR_MODIFIERS" to zero out all damage modifiers other than "BASE", effectively making damage == final_damage.
True - this adds switches in:<area> + location_flagged:<flag name>.
True - this adds <context.cancelled> and determines cancelled + cancelled:false.
Examples too long to display... Check the website for more examples
this is what fires when you punch/attack an armor_stand
ah sweet
o yikes lol
ill try
oh wait
is there a way to try without activating another script
im running this in a while loop
or would i go about making a different type of script
then running that script within the while loop
oh wait. you want to check if the armor stand is being hit WHILE the while thing is going off?
it wont work like how you're thinking
how would i go about it then
- you should put the world script with a
flagged:switch - before your while command, flag the player with a specific flag used only for this
- after your while ends, take that flag off the player
so kinda like this
- flag <player> myuniqueflag
- while thing:
- do thing
- flag <player> myuniqueflag:!
on armor_stand damaged by player flagged:myuniqueflag:
- do thing
np
the event doesnt seem to be activating
wait i got another idea, ill try left/right click checking on the armor stand
might work because its invisible and doesnt take dmg
if you copy pasted my "script", i dont know if armor_stand is the correct armor stand thing
so that might be why
hm ill check that as well
btw how do i check a specific armorstand
i have one saved
save:army
how would i implement that in the event line
youll probably need to flag the entity and then check if the hit entity has the flag
hm
ill give it a try as well
okay so I dont the damage down
when you save an entity does it only save for the one event script
or the whole world script
it saves it for that queue
with save:name
<entry[savename]>? i dont know if thats what you're looking for
unless you flag it
queue?
when your event fires, or you run a script, that script runs every command set up in one queue
when the queue ends, the saved data that isn't flagged is removed
ah k
- if <context.entity> == flag:army_stand:
- narrate "yay"
i know this is horribly wrong
dont know if thats how you implement the flag
depends on where you stored the flag
if its stored on the player, <player.flag[flagname]> will return it's value
if its on the server, <server.flag[flagname]>
i stored it as:
- flag <[entry[army].spawned_entity]> army_stand
and check for it with:
if <context.entity>.has_flag[army_stand]>:
yeah that should work,,, but you have one too many >
ah
<context.entity>.has_flag[army_stand]>
wait
can you flag entities other than the player
like an armorstand
or am i flagging this entity wrong
- flag <[entry[army].spawned_entity]> meteorite
ah syntax
i got a big problem i think
I cant use
on player damages armor_stand flagged:damaging_armor_stand:
because the armor stand doesnt take damage (invisible)
and i cant use
on player left clicks armor_stand flagged:damaging_armor_stand:
because armor stands dont take that input
yeah
ye i got that
you can flag entities, areas, the server itself
Paper
Paper
player (right|left) clicks fake entity
when a player clicks a fake entity, one that is only shown to the player and not tracked by the server.
Always. - this adds switches flagged:<flag name> + permission:<node>, in addition to the <player> link.
<context.entity> returns the EntityTag of the entity that was clicked. Note that this entity is no...
This will return null if the player clicks a fake entity that was not spawned via !command fakespawn.
<context.hand> returns an ElementTag of the hand used to click.
<context.click_type> returns an ElementTag of the click type (left/right).
True - this adds switches in:<area> + location_flagged:<flag name>.
ye i have no clue what to do now
only if there was a way to damage invisible armorstands
no clue either, we gonna have to wait until a wiser entity shows up
For left click, you can use the event "on animated", which fired whenever your left arm swings. For right click, you can just use "on right click". Then, you just need to do a raytrace to see if there's an invisible armor stand in front of you, about 4 blocks away (which is the reach of a player in survival, I believe)
sounds hard ill come back to it lol
am i going crazy or should this be adjust everytime an event happens
define meteorite_dmg:+:1
everytime that run is should be 1,2,3,4,etc
right?