#(itsnoury) offhand

48 messages · Page 1 of 1 (latest)

humble fog
#

is there a way to prevent players from putting items in offhand?

hollow yokeBOT
#

(itsnoury) offhand

hollow yokeBOT
#

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.

turbid violet
odd loomBOT
# turbid violet !e swaps items
Group

Player

Event Lines

player swaps items

Switches

main:<item> to only process the event if the item being put into the main hand matches the input item.
offhand:<item> to only process the event if the item being put into the off-hand matches the input item.

Triggers

when a player swaps the items in their main and off hands.

Has Player

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

Context

<context.main> returns the ItemTag switched to the main hand.
<context.offhand> returns the ItemTag switched to the off hand.

Determine

"MAIN:<ItemTag>" to set the item in the main hand.
"OFFHAND:<ItemTag>" to set the item in the off hand.

Cancellable

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

turbid violet
#

And if you want to stop putting it there through the inventory as well,

#

!e inventory click

odd loomBOT
#
Possible Confusion

Did you mean to search for player click_type clicks item in inventory?

odd loomBOT
# turbid violet !e inventory click
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.

turbid violet
#

!e drags in inventory

odd loomBOT
# turbid violet !e drags in inventory
Group

Player

Event Lines

player drags in inventory player drags (<item>) (in <inventory>)

Switches

in_area:<area> replaces the default 'in:<area>' for this event.
drag_type:<type> to only run the event if the given drag type (SINGLE or EVEN) was used.

Triggers

when a player drags in an inventory (that is, clicks and then holds the mouse button down while moving the mouse across multiple slots).

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 dragged.
<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.slots> returns a ListTag of the slot numbers dragged through.
<context.raw_slots> returns a ListTag of the raw slot numbers dragged through.
<context.drag_type> returns either SINGLE or EVEN depending on whether the player used their left or right mouse button.

Has Known Location

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

Cancellable

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

humble fog
#

uh sorry but how to make like a if statment with the offhand like which of the player drag <context.> returns the offhand?

turbid violet
#

<context.slots> returns a ListTag of the slot numbers dragged through.

#

Check if that contains the offhand slot's ID

#

(Not sure what is it offhand pun intended, but can test in-game and see)

humble fog
#

ok thanks so much for the help :D

gritty chasmBOT
#
Resolved

Thread closed as resolved.

humble fog
#

uh small proplem so i'm using this on player clicks item in inventory: - if <context.slot> == 41: - determine cancelled right now to cancel the player putting item into offhand but when he tries ti put item it just disappers

gritty chasmBOT
#
Thread Reopened

Thread was manually reopened by @humble fog.

odd loomBOT
# turbid violet !debug
Info: 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!

turbid violet
#

And also, what client are you testing with? default vanilla one or a modified one?

gritty chasmBOT
#
Changed to Help/Support

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

humble fog
#

vanilla

lime gulch
humble fog
#

Hmmm yeah it doen't take it tho now u can put items u just cant take them out

#

if u spam click it

#

u can put an item

turbid violet
humble fog
#

yea

turbid violet
#

Sounds like a client desync thing - is the item actually there if you relog?

humble fog
#

let me check

#

yea it still here

turbid violet
#

And do you cancel both drag and click? you might be accidently moving the mouse a bit or something which would fire the drag event

humble fog
#

Not using drag because i tried to get it to fire anything to see <context.slot> but it wasn't firing at all

#
on player clicks item in inventory:
    - if <context.slot> == 41:
      - determine cancelled
    on player drags item in inventory:
    - if <context.slot> == 41:
      - determine cancelled``` added it rn
#

and still same proplem

turbid violet
#

It's a list of slots, so can check if that contains 41

#

!l operator

odd loomBOT
# turbid violet !l operator

An operator is a tool for comparing values, used by commands like !command if, !command while, !command waituntil, ... and tags like !tag ObjectTag.is.than

Available Operators include:
"Equals" is written as "==" or "equals".
"Does not equal" is written as "!=".
"Is more than" is written as ">" or "more".
"Is less than" is written as "<" or "less".
"Is more than or equal to" is written as ">=" or "or_more".
"Is less than or equal to" is written as "<=" or "or_less".
"does this list or map contain" is written as "contains". For example, "- if a|b|c contains b:" or "- if [a=1;b=2] contains b:"
"is this in the list or map" is written as "in". For example, "- if b in a|b|c:", or "- if [a=1;b=2] contains b:"
"does this object or text match an advanced matcher" is wr...

Group

Comparables

turbid violet
#

"does this list or map contain" is written as "contains". For example, "- if a|b|c contains b:" or "- if [a=1;b=2] contains b:" the contains operator will be useful for this

humble fog
#

ah ic ill test thank you

#

oh yeah that worked Thanks so much