Page 1 of 1

Using register_on_punchnode with pointed_thing

PostPosted: Tue Jan 21, 2014 19:24
by qwrwed
I am trying to make a tool that will place a node when you use it on a certain node (similar to how buckets used to be), but I would like to be able to dig with it on all other nodes. Looking at the buckets code, I see that was achieved by using pointed_node.above, but it was on_use and on-rightclick - is there any equivalent for register_on_punchnode?

PostPosted: Tue Jan 21, 2014 20:07
by Casimir
As far as I know and as far as I understand your problem, it is currently not possible to do that. But you can use on_place for right click, so you could still dig with left.

PostPosted: Tue Jan 21, 2014 20:29
by mauvebic
Why can't you use on_use and check what pointed_thing is? You might have to give more detail.

PostPosted: Tue Jan 21, 2014 21:27
by qwrwed
Basically, I need to make a tool. This is just an example, but when you punch default:stone with it, it places default:sand in front of it. However, you can still dig things that aren't default:stone, but on_use doesn't allow this.