Solved Itemcheck in chest above

  • 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 community!

    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!

Status
Not open for further replies.

SkriptingMonkey

New Member
Jun 8, 2018
7
0
0
I want to add an itemcheck in the chest above the hopper.
If itemcheck is true, then the hopper installation will be canceled, if not, the hopper will be placed.

I have already written a primitive and simple code, but I do not know how to modify it:
code_language.skript:
on place hopper:
    if block above is chest:
        cancel event
Can help anyone? Thanks.
 
that code works. Just tested it. When I place a hopper it goes away (cancelled event)

What exactly are you trying to modify?
 
that code works. Just tested it. When I place a hopper it goes away (cancelled event)

What exactly are you trying to modify?
I want the hopper can be placed under the chest, unless there is a certain item. Nether brick, for example, why not?

If there is a brick in the chest == a hopper place event canceled
If there is no brick in the chest == a hopper is placed
 
ohhhh i see, ok, I'm not sure if that is possible, but let me test it out
[doublepost=1529480132,1529479789][/doublepost]
code_language.skript:
on place hopper:
    if block above is chest:
        loop items in block above event-block:
            if loop-item is nether brick:
                cancel event
 
ohhhh i see, ok, I'm not sure if that is possible, but let me test it out
[doublepost=1529480132,1529479789][/doublepost]
code_language.skript:
on place hopper:
    if block above is chest:
        loop items in block above event-block:
            if loop-item is nether brick:
                cancel event
Many thanks for help, friend, it work!

So, can i give a special name or lore to this loop-item?

Another example:
If the brick will have(4exmple ofc) a name "Lock" == event canceled
If the brick will have a standard name == a hopper placed
 
I would assume so.... i would have to test it, but im going to bed soon,
but i would think you could do something
"if loop-item is nether brick named "Lock":"
 
Status
Not open for further replies.