#(JustinS) ClicksBlockEvent fires when DropsItemEvent is cancelled, while looking in to air.
173 messages · Page 1 of 1 (latest)
(JustinS) Duplication bug when dropping items
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.
A better video
I now also noticed I get the effects from trying to drop it, which I should only get when leftclicking the netherstar:
on player left clicks * with:force_powers:
- run force_stun
- determine cancelled```
creative mode is whacky, try in survival
I dropped it a few times, then at once I got 5 stacks
hmmm
Please post your full latest log file.
Background Info: One of the most helpful tools to identifying the source of a problem is your server logs file! Logs contain all sorts of important information like server and plugin versions, any error messages, and a lot more important information (More Info).
How To: Your log can be found in the logs folder within your server folder. The most recent log is a text file labeled latest.log. To get help using these logs, please open that file in a text editor and copy all of the text, then open https://paste.denizenscript.com/New/Log and paste the text into the box on the page. Then click "Submit" and copy the URL and paste that back into this channel.
Please do not upload the file to Discord or to other pastebin services, use the log pastebin linked above.
yess 1 second
I couldnt get it to work again in survival: https://paste.denizenscript.com/View/123027
I could get it to work again in creative: https://paste.denizenscript.com/View/123028
This bug also happens when dropping with Q and looking at the sky (does not work when looking at blocks)
Possible pluginconflict? try cancelling on highest priority
I have no other plugins
maybe conflicting with itself??
I noticed in the logs that it's running the player right click script sometimes (pretty often) when Im dropping and not right clicking
But it doesnt say much else
[19:38:15 INFO]: Running script event 'EntityDropsItem', event='on player drops force_powers' for script 'FORCEPOWER_INPUT_SCRIPT'
[19:38:15 INFO]: Starting InstantQueue 'FORCEPOWER_INPUT_SCRIPT_2075_JumpsplatOttawa' with player 'JustinS_2006'...
[19:38:15 INFO]: +- Queue 'FORCEPOWER_INPUT_SCRIPT_2075_JumpsplatOttawa' Executing: (line 82) determine cancelled ---------+
[19:38:15 INFO]: +> Executing 'DETERMINE': outcome='cancelled' passively='false' Queue='q@FORCEPOWER_INPUT_SCRIPT_2075_JumpsplatOttawa'
[19:38:15 INFO]: Event cancelled!
[19:38:15 INFO]: Completing queue 'FORCEPOWER_INPUT_SCRIPT_2075_JumpsplatOttawa' in 0ms.
[19:38:15 INFO]: Running script event 'PlayerClicksBlock', event='on player left clicks * with:force_powers' for script 'FORCEPOWER_INPUT_SCRIPT'```
I changed my on left click * with:force_powers to:
on player left clicks entity with:force_powers:
- run force_stun
- determine cancelled
on player left clicks block with:force_powers:
- run force_stun
- determine cancelled``` but that still causes force_stun to run when trying to drop the force_star
So you can't replicate it in Survival? stuff like this happening with creative mode is very common, it's only really an issue if it happens on survival
Don't give users creative if you plan to.
Inventory testing should generally be done in survival, however if you have a need or desire to give users creative then don't give them full blown creative, because not only will that cause problems with inventory checks potentially but there is a slew of exploits such as writing books that when clicked on will run commands. ( I've had players try to make me force-op them. )
https://forum.denizenscript.com/resources/dcreative.51/ Consider dCreative if you plan to allow users to have creative.
Alr. Ill assume suddenly getting 6 stacks in survival mode was a 1 time thing, and Ill test it in survival next time
Still have this bug too
Also happening in survival
anyone know why this could be happening?
the only drop related stuff I have is:
on player drops force_powers:
- determine cancelled
on player picks up * flagged:force_inv_open:
- determine cancelled
on player drops * flagged:force_inv_open:
- determine cancelled```
and that doesnt run <player.flag[force_power]>
changed them
and all the other events that used *
They still run when dropping though
I debugged which event is triggering when I drop an item, and it's on left clicks block:
- narrate 2
- if <player.has_flag[equipped_force]>:
- narrate <player.flag[equipped_force]>
- run <script[<player.flag[equipped_force]>]>
- else:
- narrate "<&3><bold>- Select a Force Power before casting!"
- determine cancelled```
Should I report it as a bug?
Because as far as I know, dropping != clicking
dropping can be clicking actually yes; but only in inventories
!event clicks in inventory
Player
player (<click_type>) clicks (<item>) in <inventory>
with:<item> to only process the event if a specified cursor item was used.
in_area:<area> replaces the default 'in:<area>' for this event.
action:<action> to only process the event if a specified action occurred.
slot:<slot> to only process the event if a specified slot or slot_type was clicked. For slot input options, see !language Slot Inputs.
when a player clicks in an inventory. Note that you likely will also want to listen to !event player drags in inventory.
Always. - this adds switches flagged:<flag name> + permission:<node>, in addition to the <player> link.
<context.item> returns the ItemTag the player has clicked on.
<context.inventory> returns the InventoryTag (the 'top' inventory, regardless of which slot was clicked).
<context.clicked_inventory> returns the InventoryTag that was clicked in.
<context.cursor_item> returns the item the Player is clicking with.
<context.click> returns an ElementTag with the name of the click type. Click type list: <@link url...
<context.slot_type> returns an ElementTag with the name of the slot type that was clicked. Slot ty...
<context.slot> returns an ElementTag with the number of the slot that was clicked.
<context.raw_slot> returns an ElementTag with the raw number of the slot that was clicked.
<context.is_shift_click> returns true if 'shift' was used while clicking.
<context.action> returns the inventory_action. See <@link language Inventory Actions>.
... and 1 more.
ItemTag to set the current item for the event.
True - this adds switches in:<area> + location_flagged:<flag name>.
True - this adds <context.cancelled> and determines cancelled + cancelled:false.
per: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/inventory/ClickType.html
DROPThe "Drop" key (defaults to Q).
declaration: package: org.bukkit.event.inventory, enum: ClickType
this is a click type
but i think im missing if you have that event?
thats not whats happening
but that is
so pressing the drop key is a click event
ooooohhhhhhhhhhh so that's what <clicktype> means????
the more you know
well what click type do I need to specify for block clicks then?
wait
no
the event Im running is on player left clicks block with:force_powers:
that doesnt have a clicktype option
I tried
- if <context.click_type> == DROP:``` though it doesnt get run
nor does "drop"
It only happens when I LOOK at an air block though
well yes this wont ever happen since click_type in this event are only from https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/block/Action.html
declaration: package: org.bukkit.event.block, enum: Action
I just noticed:
[18:46:30 INFO]: Starting InstantQueue 'FORCEPOWER_INPUT_SCRIPT_354_KitsVii' with player 'JustinS_2006'...
[18:46:30 INFO]: +- Queue 'FORCEPOWER_INPUT_SCRIPT_354_KitsVii' Executing: (line 90) if <context.click_type> == DROP ---------+
[18:46:30 INFO]: +> Executing 'IF': use_braces='true'
[18:46:30 INFO]: Filled tag <context.click_type> with 'LEFT_CLICK_AIR'.
[18:46:30 INFO]: Comparing if LEFT_CLICK_AIR EQUALS DROP ... false```
I have a little issue following all of your threads.
Could you explain what your goal of the script is and how you replicate the duplication bug?
Can I just explain the part thats not working? Because explaining everything is wayyyyy too long
and 99% has nothing to do with this
Yeah but also provide the script please.
Alr give me a minute:
Current problem: when looking at the air and dropping my netherstar (custom item called force_powers), the "on player left clicks block" event runs.
The logs I posted 6 messages ago show how <context.click_type> recognizes it as "LEFT_CLICK_AIR" even though I dropped it. Theres no further logs that do anything with that event (I can still send them if you want me to)
The script that handles this: https://paste.denizenscript.com/View/123067
the goal of *that * event is to check whether the player LEFT CLICKS their force_powers item when looking at a block, or air (so no entities)
6 messages?
.
Oh
Ill put it in the paste websit if you want me to
but it were just 5 lines (Ill send the whole debug in that case)
when looking at the air and dropping my netherstar (custom item called force_powers), the "on player left clicks block" event runs.
this is an odd behavior. Are you sure this fires? Do you have a debug that shows this?
I'm 99% sure it fires, I checked it with narrates
I'll show the full logs
https://paste.denizenscript.com/View/123068 (narrate 2 gets run)
I tried to drop the netherstar once
I also removed the rest of all the code before, to make sure nothing else was messing it up, but it still ran that event
yes
Allright, let me test this
it does not happen when trying to drop it from the inventory
Could you record a debug of /ex reload real quick.
Okay run /denizen debug -o, then /denizen debug -r, replicate this again and run /denizen submit.
Content of Server Log Paste #123073: Denizen Debug Logs From A Minecraft Server... pasted 2024/05/25 10:04:20 UTC-07:00, Paste length: 4791 characters across 51 lines, Content: Java Version: 17.0.10Up-time: 50m
Content of Server Log Paste #123073: Denizen Debug Logs From A Minecraft Server... pasted 2024/05/25 10:04:20 UTC-07:00, Paste length: 4791 characters across 51 lines, Content: Java Version: 17.0.10Up-time: 50m
Please provide the full script that includes all the things I need to replicate it. Are you on vanilla launcher?
!paste
Help us help you by pasting your script to https://paste.denizenscript.com/New/Script and linking it back here.
Can I send it in dms? Rather not share the whole thing here seeing as it's for some other people
Errrr, no
Don't overuse the edit/delete buttons. https://denizenscript.com/discord_rules#rule8
Use the edit button to fix typos, and the delete button to remove an accidental post shortly after posting.
Do not remove a post that pings someone, do not edit or delete a post that people have already replied to.
^
and?
It's now public to everyone
Instructions:
Run:
/giveforce
then
/givepowers
and it should work
keyword should
Wow
I was able to replicate it for a second
only for a second?
👍
Though, it does not duplicate in my inventory.
But the click event fires for some reason
no thats the issue anymore, see this
we moved on from that
I dont think the duplication happens in survival
just, sometimes in creative
but thats no issue
Oh ye that's casual creative thing
so, it's at least confirmed that I'm not going insane
and there's something wrong with the event
No, but as ice said this is very common for creative
Yeah but ice and I are both experiencing it in survival
We're talking about different things
I think so too
It's about the clicks block event firing when dropping an item.
test_event:
type: world
events:
on player clicks block with:dirt:
- narrate <context.click_type>
on player drops dirt:
- determine cancelled
Here's a mcve script
Dropping an item while looking into the air is considered a click.
So, this is a denizen bug right?
it's not supposed to do this
Either that or paper/spigot issue
Y'know, Denizen just detects events when they're fired.
hmm right
So do you know if there's a workaround for this?
on player drops item:
- flag <player> prevent_bug expire:10t
- determine cancelled
on player clicks block with:dirt:
- if <player.flagged[prevent_bug]
- stop```?
idk
wild guess
This also only applies when the drops item event is cancelled.
(JustinS) ClicksBlockEvent fires when DropsItemEvent is cancelled, while looking in to air.
Thread is now a Bug thread. This indicates a core code bug that a developer must resolved, not an error message or other support topic. Please do not misuse the Bug label. Use </helpthread:1028674284870180883> to switch the thread back to a normal help thread if you are not 100% confident it is a code bug.
"dropping item is registered as a click" is a spigot bug, not Denizen
Thread is now a Help/Support thread. A helper will check your thread when available.
more specifically: Minecraft contains no "click event", Spigot registers Minecraft's "arm swing animation play" as the source of the click event, and minecraft plays an arm swing when you drop items, so it calls it a left click
it's a weird quirk of spigot
might be good to include that in the denizen docs until fixed by spigot?
But seeing as there's no official denizen fix for this as far as Im aware, would something like this work????
unlikely to ever be fixed in spigot, this bug is ancient
i would've assumed it got fixed by now if you weren't actively reporting the same old bug from when minecraft was babby
?
anyone
Was added to the meta #commit-log message
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.)
@flat wave
!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.