#(person0z) On attacked by mob

34 messages · Page 1 of 1 (latest)

pine pewter
#

Is there a way to make it so if a player is attacked by a mob type it will give the player potion effects, alnog with that the potion effects icon and particles would be hidden.

dire otterBOT
#

(person0z) On attacked by mob

dire otterBOT
#

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.

trail aurora
#

!e entity damaged by entity

delicate snowBOT
# trail aurora !e entity damaged by entity
Group

Entity

Event Lines

<entity> damaged by <entity> <entity> damaged (by <cause>) <entity> damages <entity>

Switches

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.

Triggers

when an entity is damaged.

Has Player

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.

Has NPC

when the damager or damaged entity is an NPC. Cannot be both.

Context

<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...

Determine

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.

Has Known Location

True - this adds switches in:<area> + location_flagged:<flag name>.

Examples

Examples too long to display... Check the website for more examples

trail aurora
#

!c cast

delicate snowBOT
# trail aurora !c cast
Group

entity

Syntax

cast [<effect>] (remove) (duration:<value>) (amplifier:<#>) (<entity>|...) (no_ambient) (hide_particles) (no_icon) (no_clear)

Short Description

Casts a potion effect to a list of entities.

Description

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...

pine pewter
# trail aurora !c cast

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

trail aurora
#

yes you can!

#

!e entity potion effects modified

delicate snowBOT
# trail aurora !e entity potion effects modified
Group

Entity

Event Lines

<entity> potion effects modified <entity> potion effects <change_action>

Switches

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.

Triggers

when an entity's potion effects change.

Has Player

when the entity that has changed is a player. - this adds switches flagged:<flag name> + permission:<node>, in addition to the <player> link.

Has NPC

when the entity that has changed is an NPC.

Context

<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.

Determine

"OVERRIDE:<ElementTag(Boolean)>" to set whether the new potion effect should override.

Has Known Location

True - this adds switches in:<area> + location_flagged:<flag name>.

Cancellable

True - this adds <context.cancelled> and determines cancelled + cancelled:false.

trail aurora
#

you can use the cause:MILK switch to check if the player tried clearing it with milk

#

and then cancel the event

pine pewter
trail aurora
#

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

pine pewter
#

Ahh gotcha

#

Alright

pine pewter
#

Would there be a way so if a user consumes a oraxen item that it would cancel the effects given by the script?

silver orbit
#

!e consumes

delicate snowBOT
# silver orbit !e consumes
Group

Player

Event Lines

player consumes item player consumes <item>

Triggers

when a player consumes (eats/drinks) an item (like food or potions).

Has Player

Always. - this adds switches flagged:<flag name> + permission:<node>, in addition to the <player> link.

Context

<context.item> returns the ItemTag.
<context.hand> returns an ElementTag of the hand being used to consume the item. Can be either HAN...

Determine

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.

Has Known Location

True - this adds switches in:<area> + location_flagged:<flag name>.

Cancellable

True - this adds <context.cancelled> and determines cancelled + cancelled:false.

silver orbit
#

Flag them when they eat it and check for that in the script

pine pewter
# silver orbit As in, food item?

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

silver orbit
#

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

delicate snowBOT
# silver orbit !t raw_nbt
Cannot Specify Searched Tag

Multiple possible tags: <ItemTag.raw_nbt>, <EntityTag.all_raw_nbt>, <ItemTag.all_raw_nbt>.

drifting beaconBOT
#
Thread Closing Reminder

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

drifting beaconBOT
#
Auto-Close Timeout

No response to request to close thread after 3 days. Automatically closing.

drifting beaconBOT
#
Thread Reopened

Thread was manually reopened by @unkempt ingot.

edgy hedge
#

what