Page 1 of 1

Right click trigger without having to aim at a block?

PostPosted: Wed Jun 22, 2016 15:28
by Zerock
Is there simply not a way to add a trigger to a craftitem for right click unless it's aiming at a block?

Suppose I want to make a multi-function item where each function is bound to a mouse button, is there not a way to do this?

Re: Right click trigger without having to aim at a block?

PostPosted: Wed Jun 22, 2016 16:40
by everamzah
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
on_secondary_use = func(itemstack, user, pointed_thing),
        --[[
        ^ Same as on_place but called when pointing at nothing.
        ^ pointed_thing : always { type = "nothing" }
        ]]


Is this it?

Re: Right click trigger without having to aim at a block?

PostPosted: Thu Jul 07, 2016 12:15
by Zerock
Yes, that seems to work. However, it doesn't include when pointing at blocks, so to create a universal right-click trigger, you have to define both to do the same.