#(person0z) On attacked by mob
34 messages · Page 1 of 1 (latest)
(person0z) On attacked by mob
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.
!e entity damaged by entity
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.
block:<block-matcher> to only run if the damage came from a block that matches the given material or location matcher.
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.damager_block> returns the LocationTag of a block that damaged the 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>.
Examples too long to display... Check the website for more examples
!c cast
entity
cast [<effect>] (remove) (duration:<value>) (amplifier:<#>) (<entity>|...) (no_ambient) (hide_particles) (no_icon) (no_clear)
Casts a potion effect to a list of entities.
Casts or removes a potion effect to or from a list of entities.
The effect type must be from https://hub.spigotmc.org/javadocs/spigot/org/bukkit/potion/PotionEffectType.html.
If you don't specify a duration, it defaults to 60 seconds.
An infinite duration will apply an infinite duration potion effect, refer to !objecttype DurationTag for more details.
The amplifier is how many levels to *add* over the normal level 1.
If you don't specify an amplifier level, it defaults to 1...
Would there be a way so the effect cannot be cleared by having the player drink milk, it can only be cleared if the time runs out/they die/or a custom item we have made clears it for them
Entity
<entity> potion effects modified <entity> potion effects <change_action>
cause:<cause> to only process the event when it came from a specified cause.
effect:<effect type> to only process the event when a specified potion effect is applied.
when an entity's potion effects change.
when the entity that has changed is a player. - this adds switches flagged:<flag name> + permission:<node>, in addition to the <player> link.
when the entity that has changed is an NPC.
<context.entity> returns the EntityTag.
<context.cause> returns the cause of the effect change, based on <@link url https://hub.spigotmc.o...
<context.action> returns the action of the effect changed, which can be 'added', 'changed', 'cleared', or 'removed'
<context.override> returns whether the new potion effect will override the old.
<context.new_effect_data> returns the new potion effect (in the same format as <@link tag EntityTag.effects_data>) (if any).
<context.old_effect_data> returns the old potion effect (in the same format as <@link tag EntityTag.effects_data>) (if any).
<context.effect_type> returns the name of the modified potion effect type.
"OVERRIDE:<ElementTag(Boolean)>" to set whether the new potion effect should override.
True - this adds switches in:<area> + location_flagged:<flag name>.
True - this adds <context.cancelled> and determines cancelled + cancelled:false.
you can use the cause:MILK switch to check if the player tried clearing it with milk
and then cancel the event
Gotcha, well I tried doing this but it did not work. Could you guide me on what I did wrong?
zomabie:
debug: false
type: world
events:
on zombie damages player:
- narrate "test"
- cast hunger duration:120s amplifier:2:
- if potion effects modified cause:MILK
- determine cancelled
entity potion effects modified is an event
if you want the specific potion effect to not be cleared by milk ONLY when the zombie attacks the player, it might be best to flag the player (using the flag command) with the same expiration as the potion effect and then in the entity potion effects modified event check if the player has that flag. this will prevent the player not being able to clear the effect if they didn't get the effect from the zombie attack. just a reccommendation
Would there be a way so if a user consumes a oraxen item that it would cancel the effects given by the script?
As in, food item?
!e consumes
Player
player consumes item player consumes <item>
when a player consumes (eats/drinks) an item (like food or potions).
Always. - this adds switches flagged:<flag name> + permission:<node>, in addition to the <player> link.
<context.item> returns the ItemTag.
<context.hand> returns an ElementTag of the hand being used to consume the item. Can be either HAN...
ItemTag to change the item being consumed. Use with caution, if the player is eating a stack of items, this will replace the entire stack.
True - this adds switches in:<area> + location_flagged:<flag name>.
True - this adds <context.cancelled> and determines cancelled + cancelled:false.
Flag them when they eat it and check for that in the script
Sorta, yeah. It's a oraxen item with a custom nbt. If the player eats that specific item with that specific tag then it'll clear the effects
Honestly I'd recommend just using Denizen item scripts - you can still use the same resource pack or whatever Oraxen creates, but it'll be way easier to manage within scripts
But if you want to stick with Oraxen,
!t raw_nbt
Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.
If not yet resolved, please reply below to tell us what you still need.
(Note that if there is no reply for a few days, this thread will eventually close itself.)
@pine pewter
No response to request to close thread after 3 days. Automatically closing.
Thread was manually reopened by @unkempt ingot.
what