#(JustinS) ClicksBlockEvent fires when DropsItemEvent is cancelled, while looking in to air.

173 messages · Page 1 of 1 (latest)

flat wave
modern thunderBOT
#

(JustinS) Duplication bug when dropping items

modern thunderBOT
#

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.

flat wave
lapis heath
#

creative mode is whacky, try in survival

flat wave
lapis heath
#

hmmm

flat wave
#

weeeird stuff

#

I tried ratelimiting. Didnt change anything

lapis heath
#

well not quite sure what could be the reason

#

could you

#

!logs

boreal lavaBOT
# lapis heath !logs
Info: logs

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.

flat wave
#

yess 1 second

flat wave
shadow sluice
#

Possible pluginconflict? try cancelling on highest priority

flat wave
#

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'```
flat wave
#

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
rigid mountain
maiden yarrow
#

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.

flat wave
#

Alr. Ill assume suddenly getting 6 stacks in survival mode was a 1 time thing, and Ill test it in survival next time

flat wave
#

Also happening in survival

flat wave
#

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

hot sail
#

Don't use * as match all.

#

Use the plain event instead

flat wave
#

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

opaque tinsel
#

!event clicks in inventory

boreal lavaBOT
# opaque tinsel !event clicks in inventory
Group

Player

Event Lines

player (<click_type>) clicks (<item>) in <inventory>

Switches

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.

Triggers

when a player clicks in an inventory. Note that you likely will also want to listen to !event player drags in inventory.

Has Player

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

Context

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

Determine

ItemTag to set the current item for the event.

Has Known Location

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

Cancellable

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

opaque tinsel
#

this is a click type

#

but i think im missing if you have that event?

flat wave
flat wave
#

so pressing the drop key is a click event

flat wave
#

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

lapis heath
flat wave
#

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```
hot sail
#

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?

flat wave
#

Can I just explain the part thats not working? Because explaining everything is wayyyyy too long

#

and 99% has nothing to do with this

hot sail
#

Yeah but also provide the script please.

flat wave
#

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)

hot sail
#

6 messages?

hot sail
#

Oh

flat wave
#

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)

hot sail
#

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?

flat wave
#

I'm 99% sure it fires, I checked it with narrates

#

I'll show the full logs

#

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

hot sail
#

How do you drop it?

#

Q?

flat wave
#

yes

hot sail
#

Allright, let me test this

flat wave
#

it does not happen when trying to drop it from the inventory

hot sail
#

Could you record a debug of /ex reload real quick.

flat wave
hot sail
#

Okay run /denizen debug -o, then /denizen debug -r, replicate this again and run /denizen submit.

flat wave
hot sail
boreal lavaBOT
hot sail
#

Please provide the full script that includes all the things I need to replicate it. Are you on vanilla launcher?

#

!paste

boreal lavaBOT
flat wave
hot sail
#

Errrr, no

flat wave
#

Ill just delete it once we're done

hot sail
#

It's on a public page

#

!rule 8

boreal lavaBOT
# hot sail !rule 8
Rule 8

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.

hot sail
#

^

flat wave
hot sail
#

It's now public to everyone

flat wave
#

🙄

#

fine

flat wave
#

then
/givepowers

#

and it should work

#

keyword should

hot sail
#

Wow

flat wave
#

yes it needs some improving

#

and reorganizing

#

but it works

#

that's what it's about

hot sail
#

I was able to replicate it for a second

flat wave
#

only for a second?

hot sail
#

Kinda yeah

#

I'm not sure what changed though

flat wave
#

are you looking at the air?

#

thats important

hot sail
#

Ah

#

That's the missing bit!

flat wave
#

👍

hot sail
#

Though, it does not duplicate in my inventory.

#

But the click event fires for some reason

flat wave
#

we moved on from that

#

I dont think the duplication happens in survival

#

just, sometimes in creative

#

but thats no issue

hot sail
#

Oh ye that's casual creative thing

robust umbra
#

I can only replicate this in survival

#

creative**

flat wave
#

so, it's at least confirmed that I'm not going insane

#

and there's something wrong with the event

robust umbra
#

No, but as ice said this is very common for creative

flat wave
#

Yeah but ice and I are both experiencing it in survival

hot sail
#

We're talking about different things

flat wave
#

I think so too

hot sail
#

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.

flat wave
#

it's not supposed to do this

hot sail
#

Either that or paper/spigot issue

#

Y'know, Denizen just detects events when they're fired.

flat wave
#

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

hot sail
#

(JustinS) ClicksBlockEvent fires when DropsItemEvent is cancelled, while looking in to air.

fluid wedgeBOT
#
Changed to Bug

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.

solar linden
#

"dropping item is registered as a click" is a spigot bug, not Denizen

fluid wedgeBOT
#
Changed to Help/Support

Thread is now a Help/Support thread. A helper will check your thread when available.

solar linden
#

it's a weird quirk of spigot

flat wave
flat wave
solar linden
#

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

flat wave
#

?

flat wave
#

anyone

rigid mountain
#

Was added to the meta #commit-log message

fluid wedgeBOT
#
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.)

#

@flat wave

boreal lavaBOT
# hot sail !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.

flat wave
#

it actually works wtf

#

Im a genius