Changing modes of a tool

Started by madcock83 on Wed, 09/04/2019 - 16:23

Topic category: Help with modding (Java Edition)

Last seen on 02:52, 30. Jun 2020
Joined Aug 2014
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • Comments:
Changing modes of a tool
Wed, 09/04/2019 - 16:23

Im sure its been asked but i cant find it. 
I have a tool, call it a pickaxe.  It works like a normal pickaxe.  but if it runs across a certian ore it does something else.  it also works as a 3x3x1 hammer.  All that works as it should
but what i would like to do is have the user Shift right click to make it act as a hammer and shift right click back to a normal pickaxe.  I made 2 different tools that looked alike and made it where if you shift right click it removed one and added the other.  but it never seems to go into the same slot.  and if something is in the slot next to the tool it just disappears.  

is there a way to make it do one thing, then shift click and do the other and then shift click again to go back.  simple changing mode type of thing?
thanks

 

You could do this using…
Wed, 09/04/2019 - 18:01

You could do this using procedures and store the current mode of the tool/item in the NBT variable.

Last seen on 02:52, 30. Jun 2020
Joined Aug 2014
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • Comments:
I think i see where youre…
Wed, 09/04/2019 - 18:32

I think i see where youre going with it, but i dont know enough about the NBT stuff