Register placement of block from item stack

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Omanoctoa

Member
Feb 4, 2025
12
1
3
I have a frustrating issue, I've searched high and low for an answer and can't figure it out, but I know it's something extremely simple.

I place a Cauldron, and it should add the Cauldron to a list. This works, but ONLY if I have a single Cauldron in my hand when I place it down. If I am holding more than one (ie a stack of 64; even just 2) it doesn't recognize I've placed it and add it to the list. I can click all I want (in survival or creative) and it just places Cauldrons until I get to the last Cauldron (because that means I'm only holding 1). I can use "an amount of" instead of "is 1 of", but then it only works if the player is holding multiple of the item. I need it to test for 1 or more without duplicating my code (there's a lot of code).

Snippet from my code:
Code:
on place of cauldron:
    if player's tool is 1 of cauldron named "&cBroken Cauldron":
    if player's tool an amount of cauldron named "&cBroken Cauldron": #ALTERNATIVELY, I have tried this...
        set {_loc} to location of event-block
        add {_loc} to {cauldrons::*}
        send "Cauldron placed!" to player

I have also tried - remove 1 of player's tool from player's tool - but this isn't really helpful.

I've found a similar thread on MineHut but no viable solution:
 
Last edited:
Python:
set {_amount} to item amount of held item of player


You can get item with: {_amount} of held item of player

Or

Python:
if held item of player is (item amount of held item of player) of held item of player:

2nd is more good. Try both of them and send if there are any errors. Not tested.