#(gamerlikeg) how to stop players placing items in containers?

23 messages · Page 1 of 1 (latest)

shy anvil
#

does anyone know how i can make it so players cant place an item in containers (command blocks specifically)

robust jacinthBOT
#

(gamerlikeg) how to stop players placing items in containers?

robust jacinthBOT
#

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.

keen rose
#

!e item moves from inventory to inventory

dapper yarrowBOT
# keen rose !e item moves from inventory to inventory
Group

Item

Event Lines

<item> moves from <inventory> (to <inventory>)

Triggers

when an entity or block moves an item from one inventory to another. (Hopper-style movement, not player-induced movement).

Context

<context.origin> returns the origin InventoryTag.
<context.destination> returns the destination InventoryTag.
<context.initiator> returns the InventoryTag that initiated the item's transfer.
<context.item> returns the ItemTag that was moved.

Determine

ItemTag to set a different item to be moved.

Has Known Location

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

Cancellable

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

keen rose
#

oh not this wait

#

!e player click_type clicks item in inventory

dapper yarrowBOT
# keen rose !e player click_type clicks item 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.

shy anvil
#

oh

#

thx

keen rose
#

^^

shy anvil
#

i finally looked at it and realised i didnt understand 😢

dim karma
#

Player clicks in inventory lets you cancel clicking in a specified inventory.

#

What do you mean by command blocks?

vivid cliff
shy anvil
#

yes

#

can someone write me the code pls?

dim karma
# shy anvil can someone write me the code pls?

The discord is a support platform to help others with their own projects and not write code for them, that's usually for #1023545298640982056. But your idea seems really simple that you can easily learn how to do this yourself.

#

First you should start with...

#

!guide

dapper yarrowBOT
shy anvil
#

oh ok thx