Right click trigger without having to aim at a block?

User avatar
Zerock
Member
 
Posts: 10
Joined: Sat May 23, 2015 15:06
GitHub: 2mac
IRC: Zerock
In-game: Zerock

Right click trigger without having to aim at a block?

by Zerock » Wed Jun 22, 2016 15:28

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?
 

User avatar
everamzah
Member
 
Posts: 490
Joined: Thu Jan 29, 2015 00:47
GitHub: everamzah
IRC: everamzah
In-game: everamzah

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

by everamzah » Wed Jun 22, 2016 16:40

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?
 

User avatar
Zerock
Member
 
Posts: 10
Joined: Sat May 23, 2015 15:06
GitHub: 2mac
IRC: Zerock
In-game: Zerock

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

by Zerock » Thu Jul 07, 2016 12:15

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.
 


Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 3 guests

cron