#Apply an effect within a distance of a player while exempting the player?
155 messages · Page 1 of 1 (latest)
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>
Player
For 'lowers', the item may be tracked incorrectly. Prefer 'player lowers item' (the generic item form) for a 'lowers' event (similar for 'toggles').
Also be aware this event may misfire in some cases.
This event and its data are more accurate on Paper servers.
player raises|lowers|toggles <item>
reason:<reason> to only process the event if the reason matches the input.
when a player starts or stops holding up an item, such as a shield, spyglass, or crossbow.
Always. - this adds switches flagged:<flag name> + permission:<node>, in addition to the <player> link.
<context.state> returns an ElementTag(Boolean) of whether the player raised or lowered the item.
<context.held_for> returns a DurationTag of how long the player held the item up for (only on Paper).
<context.hand> returns an ElementTag of the hand that the player is raising or lowering (only on Paper).
<context.item> returns an ItemTag of the item that the player is raising or lowering (only on Paper).
<context.reason> returns the reason for a state change. Can be: raise, lower, swap, hold, drop, quit, death.
True - this adds switches in:<area> + location_flagged:<flag name>.
How would I go on applying an effect within... lets say a 5 block area of the player?
on all the entitys within that range except the caster
Apply an effect within a distance of a player while exempting the player?
!t find_entities
Returns a list of entities within a radius, with an optional search parameter for the entity type.
Result list is sorted by closeness (1 = closest, 2 = next closest, ... last = farthest).
finding
ListTag(EntityTag)
!t listtag.exclude
Returns a new ListTag excluding the items specified.
ListTag
# Narrates a list of "one|three"
- narrate <list[one|two|three|four|two].exclude[two|four]>
you'll exclude the player
thanks
So I would do
- cast slow duration:1 <LocationTag.find_entities[(<player>)].within[<5.5>].exclude[1]> hide_particles no_icon
?
what no
you'd have to provide a valid location in the place of LocationTag
the find_entities takes an input like find_entities[zombie]
same thing for the within, that goes like within[10]
and, the exclude
im not sure where you took that 1 from
lets think through it. if you get all entities within 5 blocks of you, let's say it returns a list like this:
(this is NOT how it would work, it's purely pseudo-code just to help you see it)
li@zombie|skeleton|another_player|you
1 isnt here, you cant exclude it from this list
while exempting the player
so, you'll want to exclude the player
Returns the location of the entity.
For living entities, this is at the center of their feet.
For eye location, use !tag EntityTag.eye_location
Works with offline players.
location
LocationTag
<player> is a valid entitytag
<player.location> would be the equivalent of ~ ~ ~, it gets the exact position the player is in
<<player.location>.find_entities[player].within[5].exclude[<context.player>]>
Would this work?
I'm pretty new to denizen so I'm sorry if I don't fully understand
well, firstly i assumed you have already read the guide, but you dont seem to grasp the idea of how tags work, so i'm going to plug the guide for you
!guide
View the Denizen Beginner's Guide at https://guide.denizenscript.com/
go read it my guy
!g your first tag
View the guide page 'Your First Tags' at: https://guide.denizenscript.com/guides/first-steps/tags.html
this'll come in hand
I did read that -_-
Do you still need help?
yes please
!paste
Help us help you by pasting your script to https://paste.denizenscript.com/New/Script and linking it back here.
Post your script so we see where you're at please
alright
Content of Denizen Script Paste #105810: goat slow... pasted 2023/01/29 05:19:35 UTC-08:00, Paste length: 204 characters across 4 lines, Content: goat_slow: type: world
What text-editor do you use to edit this file?
Vs code
and do you have the denizen extension for it?
and a lot of other things lmao
yeeaaah
your extension should give you warnings, like this
if you don't see it, you should install the DenizenScript extension as mentioned
Yes
alright, what errors is the editor giving to you?
it should be giving plenty
Not by my comupter currently, will check later
!info nothome
We sometimes see users opening support threads or replying to them while not able able to test things.
This is often revealed in messages like "I'm not home right now and wanted to ask", or "I can't access my server but I think I remember the details", ...
This often leads to one of two problems:
• The user asks questions they could have answered themself if they were at their server. This is a problem because it wastes the limited resource of our expert helper team on simple questions that would never have been asked if it were not for the fact that the user wasn't near their server.
• A helper enters the thread to actively assist but is unable to provide any help because the user is unable to actually act on any responses. Many threads start with requests for basic followup information such as server logs or other demonstrative data from the server, that of course they can only provide when they have access to that data.
In both cases, helper time is wasted and the user don't actually get to act on any responses faster than they would have been able to had they simply waited til they were able to access their server before asking for help.
given the above, just review this when you do get home
you've been given everything you need to correct this when you do
Alright
I think I figured out my mistake
Il try it
what is it like right now
goat_slowness:
type: world
events:
after player raises goat_horn:
- cast slow duration:1 <player.location.find_entities[player].within[5].exclude[<context.player>]> hide_particles no_icon
VS code detected no problems
!paste
Help us help you by pasting your script to https://paste.denizenscript.com/New/Script and linking it back here.
Paste it on the paste site
Content of Denizen Script Paste #105816: goaty slownesssy... pasted 2023/01/29 11:32:31 UTC-08:00, Paste length: 211 characters across 4 lines, Content: goat_slowness: type: world
If you need help with a script issue, one of the most powerful tools Denizen has to offer is full debug output. This is displaying in your console whenever scripts are running until you turn debug off. To share a debug log quickly and easily with helpers, simply run the command /denizen debug -r in-game to begin recording, then run through the part of the script you need help with, then run the command /denizen submit. This will give you a link to a paste of the debug log, which you can then copy/paste back to us!
Alrighty
Content of Server Log Paste #105817: Denizen Debug Logs From CloudedSky Pre-Release Soon! | dsc.gg/csky... pasted 2023/01/29 11:33:45 UTC-08:00, Paste length: 1878 characters across 27 lines, Content: Java Version: 17.0.5Up-time: 16m
Okay the event doesn't fire. Did you use a goat_horn?
yep
Il try changing it to "on"
Content of Server Log Paste #105819: Denizen Debug Logs From CloudedSky Pre-Release Soon! | dsc.gg/csky... pasted 2023/01/29 11:35:41 UTC-08:00, Paste length: 1875 characters across 27 lines, Content: Java Version: 17.0.5Up-time: 18m
hmm
Still didn't fire
It's probably not the correct event for using goat_horns
goat_slowness:
type: world
events:
on player raises goat_horn:
- cast slow duration:1 <player.location.find_entities[player].within[5].exclude[<context.player>]> hide_particles no_icon
It should work
.
Yeah as I said thats probably not the correct event.
such as a shield, spyglass, or crossbow
maybe its not listed here? but i doubt it
I don't see a reason why goat horns shouldn't be listed among that
Is there an "on right click" event?
Player
this event may in some cases double-fire, requiring usage of the 'ratelimit' command (like 'ratelimit <player> 1t') to prevent doubling actions.
player (right|left) clicks <block>
with:<item> to only process the event if a specified item was held.
using:hand/off_hand/either_hand to only process the event if the specified hand was used to click.
type:<material> to only run if the block clicked matches the material input.
when a player clicks on a block or in the air.
Always. - this adds switches flagged:<flag name> + permission:<node>, in addition to the <player> link.
<context.item> returns the ItemTag the player is clicking with.
<context.location> returns the LocationTag the player is clicking on.
<context.relative> returns a LocationTag of the air block in front of the clicked block.
<context.click_type> returns an ElementTag of the Spigot API click type <@link url https://hub.spi...
<context.hand> returns an ElementTag of the used hand.
True - this adds switches in:<area> + location_flagged:<flag name>.
True - this adds <context.cancelled> and determines cancelled + cancelled:false.
That required the player to click at a block tho
oh
You probably want a ratelimit on it, otherwise it fires when a player does not use a goat_horn but right click with it.
!c ratelimit usage
queue
ratelimit [<object>] [<duration>]
Limits the rate that queues may process a script at.
- ratelimit <player> 10s
- narrate "Wow!"
if you use plaintext "block", it will fire no matter which block you aim it at
So just "player right clicks block"?
Well you'd want to only fire if a player uses a goat_horn.
This is explained here:
!guide first world
View the guide page 'Your First World Script' at: https://guide.denizenscript.com/guides/first-steps/world-script.html
ik
I just wanted to make sure I got the base right
Now I have another problem
It fires all good and thing and applies slowness
But also to the caster
!debug
If you need help with a script issue, one of the most powerful tools Denizen has to offer is full debug output. This is displaying in your console whenever scripts are running until you turn debug off. To share a debug log quickly and easily with helpers, simply run the command /denizen debug -r in-game to begin recording, then run through the part of the script you need help with, then run the command /denizen submit. This will give you a link to a paste of the debug log, which you can then copy/paste back to us!
mhm
Content of Server Log Paste #105821: Denizen Debug Logs From CloudedSky Pre-Release Soon! | dsc.gg/csky... pasted 2023/01/29 11:46:14 UTC-08:00, Paste length: 3470 characters across 37 lines, Content: Java Version: 17.0.5Up-time: 5m 44s
Oh look an error!
Player
this event may in some cases double-fire, requiring usage of the 'ratelimit' command (like 'ratelimit <player> 1t') to prevent doubling actions.
player (right|left) clicks <block>
with:<item> to only process the event if a specified item was held.
using:hand/off_hand/either_hand to only process the event if the specified hand was used to click.
type:<material> to only run if the block clicked matches the material input.
when a player clicks on a block or in the air.
Always. - this adds switches flagged:<flag name> + permission:<node>, in addition to the <player> link.
<context.item> returns the ItemTag the player is clicking with.
<context.location> returns the LocationTag the player is clicking on.
<context.relative> returns a LocationTag of the air block in front of the clicked block.
<context.click_type> returns an ElementTag of the Spigot API click type <@link url https://hub.spi...
<context.hand> returns an ElementTag of the used hand.
True - this adds switches in:<area> + location_flagged:<flag name>.
True - this adds <context.cancelled> and determines cancelled + cancelled:false.
Fixed it
How so?
<player>
Perfect :)
:D Thanks a lot, not only have you helped me make a cool combat feature for my server, but you also helped me learn
but you also helped me learn
That's the goal here
You're also way more patient than the time I had to deal with the luckperms support server with storage errors a couple years back
God that was an awful experience
@karmic mesa
Thread was closed either automatically by timeout or by the Discord manual close button. If closing was intentional, please use </resolved:1028673926114594866> or </invalid:1028673926898909185>.