#(Joshie) Hey! Hunter skill advice!

261 messages · Page 1 of 1 (latest)

half junco
#

Hey so my idea for this hunter skill is, Once you activate the skill (this parts all done) if you kill a hostile mob/monster. It will strike a maximum of 3 hostile mobs within 20 blocks with lightning and kill them too.

     on player flagged:skill.huntershostilitytime damages !player:
          - define loc <context.location>
          - foreach <[loc].find.living_entities[is_monster].within[10]> as:entity:
            - kill <[entity]>

This is what I have so far. But it seems to be killing me lol!

ripe saffronBOT
#

(Joshie) Hey! Hunter skill advice!

ripe saffronBOT
#

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>

half junco
#

Yeah my player tag is included with that apparently

undone lichen
#

Any debug when it kills you?

half junco
#

Ah i'll check rq

undone lichen
#

I suppose it can happen when there is no monsters nearby, so <[entity]> is basically null

half junco
#

Interesting..

#

There is defo monsters around me, they die too xD

#

Is context.location not valid for damages?

#

!c damaged

mossy flumeBOT
#
Possible Confusion

Did you mean to search for damage?

#
Possible Confusion

Did you mean to search for mechanism damage?

half junco
#

!e damages

mossy flumeBOT
# half junco !e damages
Cannot Specify Searched Event

Multiple possible events: vehicle damaged, player damages block, entity damaged by entity, crackshot weapon damages entity.

half junco
#

!e entity damaged by entity

mossy flumeBOT
# half junco !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

half junco
#

Ah

#

I see.

undone lichen
#

A I see too

#

there is no context.location there

half junco
#

yeah lol

livid merlin
#

<context.entity.location> no?

half junco
#

context.entity.location

#

Yeah

#

That also killed me

#

wtf.

undone lichen
#

debug?

half junco
#

sure 1 sec

livid merlin
#

i dont know about that tag

#

i mean im not sure but

#

<[loc].find.living_entities[is_monster].within[10]>

half junco
#

Yeah that returns ME included lmao

livid merlin
#

<[loc].find.living_entities.filter[is_monster].within[10]> no?

half junco
#

I'll try that

#

Nah that isnt right

livid merlin
#

mb

half junco
#

It's fine

#

i'll debug rq

livid merlin
#

<[loc].find.living_entities.within[10].filter[is_monster]>

half junco
#
+> Executing 'KILL': entities='[p@6899ca7e-97e7-40de-8ac9-0939d4371c42 (JoshJustGames)]'
#

I'll try that tech 1 sec

undone lichen
#

so you're a monster

livid merlin
#

kekw

half junco
#

Fixed i think tech

#

😄

livid merlin
#

yay!

humble lightBOT
#

+> YAY!!!

half junco
#

lmao wtf

#

yay!

humble lightBOT
#

+> YAY!!!

half junco
#

:0

#

Okay sooo

     on player flagged:skill.huntershostilitytime damages !player:
          - define loc <context.entity.location>
          - foreach <[loc].find.living_entities.within[10].filter[is_monster]> as:entity:
            - kill <[entity]>

I only want it to kill a maximum of monsters in this range

#

Can i stop the for each once it reaches 3?

#

it's like index or something right

undone lichen
#

!c foreach

mossy flumeBOT
# undone lichen !c foreach
Group

queue

Syntax

foreach [stop/next/<object>|...] (as:<name>) (key:<name>) [<commands>]

Short Description

Loops through a ListTag, running a set of commands for each item.

Description

Loops through a ListTag of any type. For each item in the ListTag, the specified commands will be ran for that list entry.

Alternately, specify a map tag to loop over the set of key/value pairs in the map, where the key will be <[key]> and the value will be <[value]>.
Specify "key:<name>" to set the key definition name (if unset, will be "key").

Specify "as:<name>" to set the value definition name (if unset, will be "value").
Use "as:__player" to change the queue's player link, or "as:__npc" t...

livid merlin
#

<[loop_index]>

half junco
#

Ah so if <[loop_index]> = 3 stop

undone lichen
#

check meta, there is <[value]>/<[loop_index]>

half junco
#

got ya

#
     on player flagged:skill.huntershostilitytime damages !player:
          - define loc <context.entity.location>
          - foreach <[loc].find.living_entities.within[10].filter[is_monster]> as:entity:
            - if <[loop_index]> == 3:
              - stop
            - else:
              - kill <[entity]>
#

something like this I guess

#

Oops the kill needs moving

#

Edited.

undone lichen
#

foreach stop will be better, stop stops script entirely - foreach stop will stop only the current foreach

livid merlin
#

either that or just get the first 3 in the list

#

!t <ListTag.get[<#>].to[<#>]>

mossy flumeBOT
# livid merlin !t <ListTag.get[<#>].to[<#>]>

Returns all elements in the range from the first index to the second.
Note the index input options described at !objecttype listtag

Returns

ListTag

Examples
# Narrates a list of "one|two|three"
- narrate <list[one|two|three|four].get[1].to[3]>
# Narrates a list of "three|four"
- narrate <list[one|two|three|four].get[3].to[last]>
# Narrates a list of "three|four"
- narrate <list[one|two|three|four].get[-2].to[-1]>
half junco
#

Hmmm

#

that only kills 1

#
     on player flagged:skill.huntershostilitytime damages !player:
          - define loc <context.entity.location>
          - foreach <[loc].find.living_entities.within[10].filter[is_monster]> as:entity:
            - if <[loop_index]> == 3:
              - foreach stop
            - else:
              - kill <[entity]>
#

Well,

#

the one i kill dies lol

undone lichen
#

wait-wait, you kinda messed with that

half junco
#

I did?

livid merlin
#

`- foreach <[loc].find.living_entities.within[10].filter[is_monster].get[1].to[3]>:

  • kill em`
undone lichen
#

uh or nope, just got a little bit confused with the way you did that.

          - define loc <context.entity.location>
          - foreach <[loc].find.living_entities.within[10].filter[is_monster]> as:entity:
            - kill <[entity]>
            - if <[loop_index]> >= 3:
              - foreach stop```
half junco
#

Techs idea seems good but uh

#

OH

livid merlin
#

also exclude <context.entity> from the list

half junco
#

Any idea whats wrong with this?

shell socket
#

see what vscode tells you

#

generally when it does that to me its invalid yaml formatting/indentation

half junco
#

Invalid yaml yeah

#

I know it indent but like

#

If i pull back the kill

#

Its not in the foreach

shell socket
#

you can only indent 2 or 4 spaces

#

you're indenting 6 spaces there

half junco
#

I'm literally blind

ivory sky
#

the - should be lined up with the grey vertical bar

#

it shows you indentation level

half junco
#

ty and my bad guys

#

Silly mistake

#

oh wait that wast it either

#

The hell

#

Its the for each line, somehow

ivory sky
#

there is a : next to the tag

half junco
#

At the end?

ivory sky
#

no

#

wait yes

half junco
#

You mean as:entity:

#

right?

undone lichen
#

Before as

ivory sky
half junco
#

omfg

undone lichen
half junco
#

Woo it seems to work

ivory sky
#

yay

humble lightBOT
#

+> YAY!!!

half junco
#

Now all I need to do is strike them with lightning ;D

#

To give a cool effect lol

undone lichen
#

there is a command in denizen exist for that btw :D

half junco
#

a smite command?

#

!c smite

mossy flumeBOT
#
Possible Confusion

Did you mean to search for sit?

#
Possible Confusion

Did you mean to search for mechanism size?

undone lichen
#

!c strike

ivory sky
#

!c strike

mossy flumeBOT
# undone lichen !c strike
Group

world

Syntax

strike [<location>] (no_damage) (silent)

Short Description

Strikes lightning down upon the location.

Description

Causes lightning to strike at the specified location, which can optionally have damage disabled.

The lightning will still cause fires to start, even without the 'no_damage' argument.

Lightning caused by this command will cause creepers to activate. Using the no_damage argument makes the
lightning do no damage to the player or any other entities, and means creepers struck will not activate.

Use 'silent' to remove the sound of the lightning strike.
NOTE: The 'silent' option appears to have been removed in a Minecraft update and thus lightning will be audible until/unless Mojang re-adds it.

mossy flumeBOT
# ivory sky !c strike
Group

world

Syntax

strike [<location>] (no_damage) (silent)

Short Description

Strikes lightning down upon the location.

Description

Causes lightning to strike at the specified location, which can optionally have damage disabled.

The lightning will still cause fires to start, even without the 'no_damage' argument.

Lightning caused by this command will cause creepers to activate. Using the no_damage argument makes the
lightning do no damage to the player or any other entities, and means creepers struck will not activate.

Use 'silent' to remove the sound of the lightning strike.
NOTE: The 'silent' option appears to have been removed in a Minecraft update and thus lightning will be audible until/unless Mojang re-adds it.

half junco
#

Oh damn!

ivory sky
half junco
#
     on player flagged:skill.huntershostilitytime damages !player:
        - define loc <context.entity.location>
        - foreach <[loc].find.living_entities.within[10].filter[is_monster].get[1].to[3]> as:entity:
          - strike <[loc]> no_damage
          - kill <[entity]>
#

well that seemed too easy for a skill lmao

#

Tryna think of potential issues.

#

It wont fire on players with the !player right?

ivory sky
#

the best way to test for issues is to

#

!tias

mossy flumeBOT
# ivory sky !tias
Info: tias

Try it and see!

If somebody pulled this up for you, you're probably asking a question of the public channel that's easier and faster to figure out by just attempting your idea in-game and looking at the result of that attempt.

half junco
#

I'm thinking about making it uh, when you kill a mob

undone lichen
#

(it has to be too loud)

half junco
#

not when you damage one

#
on player flagged:skill.huntershostilitytime kills !player:
#

Will this include uh

#

Item frames etc?

undone lichen
#

Try it, it'll be better, but paintings and item frames are hanging

#

and there is separate event for them

#

but there is boats and armorstands anyway

#

so check

half junco
#

Wondering if i can just specify the uh same as I did but in the event line?

#

Is_monster

undone lichen
#

vanilla_tagged?

#

I'm actually not sure that it will work, but there is a tag monster in minecraft so- worth to try.

half junco
#

Can that go in an event line?

#
     on player flagged:skill.huntershostilitytime kills vanilla_tagged:monster:
        - define loc <context.entity.location>
        - foreach <[loc].find.living_entities.within[10].filter[is_monster].get[1].to[3]> as:entity:
          - strike <[loc]> no_damage
          - kill <[entity]>
undone lichen
#

kills entity vanilla_tagged I guess

ivory sky
#

you should use an if check for if it is a monster. there are no switches for the event

half junco
#

It doens't like that

#

Ah okay thanks bread 😄

undone lichen
#

Sorry then 👉 👈

ivory sky
#

no worries

half junco
#
     on player flagged:skill.huntershostilitytime kills !player:
        - if <context.entity.type> == monster:
          - define loc <context.entity.location>
          - foreach <[loc].find.living_entities.within[10].filter[is_monster].get[1].to[3]> as:entity:
            - strike <[loc]> no_damage
            - kill <[entity]>
ivory sky
#

but the if may not be necessary, because from what i can tell the foreach already filters for entities that are monsters if i understand correctly

half junco
#

I think context.entity is.. wrong?

#

Oh wait you might have a point bread lol

#

Welll. Kind of i mean, If will still run the for each loop if you try it on an item frame etc

#

but we can stop that.

#

You could kill an item frame and have 3 random zombies die outside your house xD

#

Yeah i needa figure this line out lmao

- if <context.entity.type> == monster:
undone lichen
#

- if <context.entity.is_monster>:

half junco
#

Bruh

#

OH

#

right yeah

#

derp

undone lichen
#

entity type is the entity name as I remember (SKELETON, ZOMBIE etc)

#

and actually for entity type you will use entity_type

half junco
#

it works as it is rn

#

Nothing happens on chicken

#

but on a zombie it works

#

Final issue I think on this isss

#
     on player flagged:skill.huntershostilitytime kills !player:
        - if <context.entity.is_monster>:
          - define loc <context.entity.location>
          - foreach <[loc].find.living_entities.within[10].filter[is_monster].get[1].to[3]> as:entity:
            - strike <[loc]> no_damage
            - kill <[entity]>
#

All 3 lightning strikes hit the first mo....

#

I just realised why

#

im striking <[loc]>

livid merlin
#
  • stike <[entity].location> no_damage
half junco
#

Hmmm

undone lichen
#

check <[entity.location]>

half junco
#

Yeah

undone lichen
#

You defined <[loc]> at the start and it will remain static

half junco
#

Yeah i caught that was i typed it xD

#

Weird now i got no lightning

#
     on player flagged:skill.huntershostilitytime kills !player:
        - if <context.entity.is_monster>:
          - define loc <context.entity.location>
          - foreach <[loc].find.living_entities.within[10].filter[is_monster].get[1].to[3]> as:entity:
            - strike <[entity.location]> no_damage
            - kill <[entity]>
livid merlin
#

<[loc].find.living_entities.within[10].filter[is_monster].exclude[<context.entity>].get[1].to[3]>

half junco
#

The hell is that xD

undone lichen
#

<[entity]> is your definition, don't do anything to brackets to add something, <[entity].location>

livid merlin
#

idk if the list would contain the killed entity actually

#

you can just leave it as it is

half junco
undone lichen
#

in your script you're referring not to <[entity]> but to <[entity.location]> instead

livid merlin
#

<[entity].location>

#

not <[entity.location]>

livid merlin
#

nice!

half junco
#

Thanks guys 😄

livid merlin
#

you're welcome

#

if thats all

#

well

undone lichen
#

Love that sound effects :)

livid merlin
#

u could close

half junco
#

I just noticed uh

livid merlin
#

i thought i could do pleaseclose

#

lmfao

half junco
#

CRAP

#

Wait actually

#

I selected no damage

#

they have no drops?

#
- kill <[entity]>
#

atleast i dont think they do?

undone lichen
#

It just kills them, drops should be there

half junco
#

Zombies always drop flesh right?
100% of time?

undone lichen
#

Just check it for a few times :D

half junco
#

Yeah drops are there ;D

#

My bad

#

item merging was throwing me off

#

Thanks guys will close ❤️

#

appreciate it alot

hearty flintBOT
#
Resolved

Thread closed as resolved.

half junco
#

Sorry for reopen but I just realised something

hearty flintBOT
#
Thread Reopened

Thread was manually reopened by @half junco.

half junco
#
     on player flagged:skill.huntershostilitytime kills !player in:nearlands|farlands|nether|end:
        - if <context.entity.is_monster>:
          - define loc <context.entity.location>
          - foreach <[loc].find.living_entities.within[10].filter[is_monster].get[1].to[3]> as:entity:
            - strike <[entity].location> no_damage
            - kill <[entity]>
#

You could kill the dragon or warden/wither by killing an enderman thats near it lol

#

in 1 hit.

#

right?

#
          - foreach <[loc].find.living_entities.within[10].filter[is_monster].get[1].to[3]> as:entity:
            - if <[entity]> == ender_dragon|wither|warden:
              - foreach stop
            - strike <[entity].location> no_damage
            - kill <[entity]>
#

Not sure if something like this will work

#

Would it be <[entity].name>

#

?

livid merlin
#

!t entity_type

mossy flumeBOT
livid merlin
#

!t entitytag.entity_type

mossy flumeBOT
half junco
#

Sweet so

#
- if <[entity].entity_type> == warden:
#

This works but I need to chain multiples

#
- if <[entity].entity_type> == warden|ender_dragon:

Stops it from working hmm

sonic lichen
#

if <[entity]> matches warden|ender_dragon should work

half junco
#

<[entity].entity_type> surely?

#
- if <[entity].entity_type> matches warden|ender_dragon|wither:
#

Got it tyty