#(sparkwave) "cast" doesn't seem to work on hit target
71 messages · Page 1 of 1 (latest)
(sparkwave) "cast" doesn't seem to work on hit target
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.
This doesn't do anything
The "whoop" shows up in chat correctly, so the if statement works
But the cast doesn't
even if I remove the .as[list]
!e tries to
!e player tries to attack entity
Paper
Paper
player tries to attack <entity>
with:<item> to only process the event if the player attacks the entity with the specified item.
when the player tries to attack an entity. This occurs before any of the damage logic, so cancelling this event will prevent any sort of sounds from being played when attacking.
Always. - this adds switches flagged:<flag name> + permission:<node>, in addition to the <player> link.
<context.entity> returns the entity that was attacked in this event.
<context.will_attack> returns whether this entity would be attacked normally.
Entities like falling sand will return false because their entity type does not allow them to be attacked.
Note: there may be other factors (invulnerability, etc.) that will prevent this entity from being at...
True - this adds <context.cancelled> and determines cancelled + cancelled:false.
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...
Returns the object, automatically converted to the named object type.
Type names can be of the long form, like "ListTag", "MapTag", "ElementTag", ... or the short form, like "List", "Map", "Element", ...
Type name input is not case-sensitive, so "List" or "list" are the same.
ObjectTag
my_example:
type: task
# Some input can be any raw object type, but will be forced to a list using 'as[list]' below
definitions: some_input
script:
- narrate "Input list has size <[some_input].as[list].size>"
It's unnecessary to do as[list] for a single input here. The list is optional, if you supply a single value then it'll ake it.
However can you..
!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!
I'd like to see what the script is saying.
Content of Server Log Paste #127468: Denizen Debug Logs From "Kato's Minecraft Remix!"... pasted 2024/10/23 16:10:37 UTC-07:00, Paste length: 36833 characters across 280 lines, Content: Java Version: 21.0.3Up-time: 58m
Well, there's a lot of extra log spam
This specific code is on lines 90-92
I'd have to implement checks for whether custom_model_data is valid everywhere for this to not error constantly and idk how to do that here
But that's not the issue, the issue is that the log doesn't seem to say anything useful and the cast thing doesn't work
!t objecttag.exists
Returns true if the object exists (is non-null). Returns false if the object doesn't exist, is null, or the tag errored.
This functions as a fallback - meaning, if the tag up to this point errors, that error will be hidden.
ElementTag(Boolean)
Returns whether the item has a custom model data ID number set on it.
Also see !tag ItemTag.custom_model_data.
properties
ElementTag(Boolean)
ItemTag.custom_model_data
Well, okay, I'll do another one with this
Even if this makes my code waaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaay longer
This may be unnecessary.
What item has the custom model data? I don't see any provided in the script.
Only a selleritem
Oh sorry.
I didn't see you put down a haste.
But I'd still like to know what item has the custom model data.
Also
!g don't compare raw
View the guide page 'Common Mistakes - Don't Compare Raw Objects' at: https://guide.denizenscript.com/guides/troubleshooting/common-mistakes.html#don-t-compare-raw-objects
I can't not compare raw
It doesn't work if I just do <player.item_in_hand.material> == iron_sword
It just doesn't check correctly
Only if I do m@iron_sword
Correct.
That is because it's a material tag.
There is a slew of solutions on that page that I linked you.
There is never any reason to compare raw objects of any kind.
ooooooooh okay
I'll take another record with debug enabled and with those fixes applied
Oh right.
And let's...
Content of Server Log Paste #127468: Denizen Debug Logs From "Kato's Minecraft Remix!"... pasted 2024/10/23 16:10:37 UTC-07:00, Paste length: 36833 characters across 280 lines, Content: Java Version: 21.0.3Up-time: 58m
Purpur version 1.21.1-2311-0fa9a50 (MC: 1.21.1)
Citizens: 2.0.35-SNAPSHOT (build 3494) -- (:warning:Outdated build, behind by 104)
Denizen: 1.3.1-SNAPSHOT (build 7059-DEV) -- (:warning:Outdated build, behind by 21)
Depenizen: 2.1.1 (build 864) -- (Current build :white_check_mark:)
Sentinel: 2.9.1-SNAPSHOT (build 523) -- (Outdated build, behind by 2)
@cyan berry
:triangular_flag_on_post: Offline.
3 (:triangular_flag_on_post: Offline)
21.0.3 :white_check_mark:
WorldGuard: 7.0.11-beta1+a801a9d, MythicMobs: 5.6.2-3e052553, ProtocolLib: 5.3.0-SNAPSHOT-723, Quests: 5.1.4-b507
AuthMe: 5.6.0-bCUSTOM :triangular_flag_on_post: (Offline login authenticator plugin)
FastLogin: 1.12-SNAPSHOT-4dd6b9a
SkinsRestorer: 15.4.3 :triangular_flag_on_post: (Offline skins fixer plugin)
PvPManager: 3.18.26 - :warning: PvPManager is known to cause issues related to Citizens and Sentinel.
Geyser-Spigot: 2.4.3-SNAPSHOT - Bedrock clients are unsupportable. Please do all testing with a Java Edition client.
floodgate: 2.2.3-SNAPSHOT (b109-49bd564)
TAB: 4.1.6 - This plugin adds Below_Name scoreboards to NPCs.
ViaVersion: 5.0.5 - Mixed client vs server versions can sometimes cause packet-related issues.
Multiverse-Core: 4.3.12 - Multi-world configuration plugins may affect NPCs in unexpected ways.
FastAsyncWorldEdit: 2.11.3-SNAPSHOT-937;91bdd15 - This plugin has been known to break the plugin load order on many servers, due to usage of the 'loadbefore' directive in its 'plugin.yml'.
GSit: 1.10.0 - 'Sit on other players' or 'sit on mobs' plugins sometimes allow players to sit on NPCs.
Content of Server Log Paste #127469: Denizen Debug Logs From "Kato's Minecraft Remix!"... pasted 2024/10/23 16:32:11 UTC-07:00, Paste length: 103001 characters across 911 lines, Content: Java Version: 21.0.3Up-time: 1h 19m
Oof. Exceptions.
And a slew of other problems.
There's something here that is beyond me and only a helper must address.
Alright
The exceptions are from a separate thing that's supposed to create chat sounds
Extra question, how do I create a cuboid tag from two locations? Because that doesn't seem to work for me either
Unfortunately, there is a problem that only a helper must address before continuing further with support.
Turns out I was applying poison to a zombie which heals it instead
Thread closed as resolved.
@covert compass cracked @icy shard
Thread was manually reopened by @dense umbra.
Role applied.
Thread created: #1306736746649751692