Hello all, sorry for the slew of recent questions but I'm learning denizen lately and am looking to allow players to right click a grindstone to produce a custom item from the item held in their hand, I got it to replace what they were holding with the new product but I can't get the inventory of the grindstone to stop appearing. The best I could do was get it to close immediately, but it's a bit ugly having it flash open for a moment with every click. Let me know! ❤️
#(calaritooo) Prevent inventory from opening
21 messages · Page 1 of 1 (latest)
(calaritooo) Prevent inventory from opening
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.
afaik you can't cancel the inventory opens event
but
!e player right|left clicks block
Group
Player
**WARNING**
this event may in some cases double-fire, requiring usage of the 'ratelimit' command (like 'ratelimit <player> 1t') to prevent doubling actions.
**WARNING**
this sometimes fires at unexpected times, eg when dropping an item.
Event Lines
player (right|left) clicks <block>
Switches
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.
Triggers
when a player clicks on a block or in the air.
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 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.
Has Known Location
True - this adds switches in:<area> + location_flagged:<flag name>.
Cancellable
True - this adds <context.cancelled> and determines cancelled + cancelled:false.
you can cancel this and it should work ^
If you are already using that event
!c determine
Group
queue
Syntax
determine (passively) [<value>]
Short Description
Sets the outcome of a script.
Related Guide Page
Description
Sets the outcome of a script.
The most common use case is within script events (for example, to cancel the event).
This is also required for all procedure scripts.
It may be useful in other cases (such as a task script that returns a result, via the save argument).
By default, the determine command will end the queue (similar to !command stop).
If you wish to prevent this, specify the "passively" argument.
To make multiple determines, simply use the determine command multiple times in a row, with the "passively" argument on each.
By default, the determine command will end the queue (similar to !command stop).
If you wish to prevent this, specify the "passively" argument.```
use the passively argument
eg
on player right clicks grindstone with:your_item:
- determine cancelled passively
- the rest of your code```
feel free to ask if you have anymore questions regarding this :), otherwise
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.)
@crude coral
thank u!!
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.)
@crude coral