How to transform item in hand?

Started by Erfgs45 on Sun, 10/25/2020 - 18:22

Topic category: Help with MCreator software

Last seen on 16:56, 21. Nov 2020
Joined Oct 2018
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
How to transform item in hand?
Sun, 10/25/2020 - 18:22

I would like to do a procedure that if the player right-clicks with the item it transforms into another, for axample right-click with sword = becomes pickaxe.

 

Can someone help me please?

Last seen on 16:56, 21. Nov 2020
Joined Oct 2018
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
(BTW with right-click, i…
Sun, 10/25/2020 - 18:28

(BTW with right-click, i mean on ablock, on the air, on an entity, ect.)

Last seen on 22:03, 7. Nov 2020
Joined Oct 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Just execute a command: …
Sun, 10/25/2020 - 18:57

Just execute a command:

/replaceitem entity @s weapon.mainhand [item-id]

Last seen on 22:03, 7. Nov 2020
Joined Oct 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
4 xample:    if ( [item in…
Sun, 10/25/2020 - 19:01

4 xample:

 

 if ( [item in mainhand of <entity>] == [sword_item] ) do

          /replaceitem entity @s weapon.mainhand [pickaxe_item id]

 elseif ( [item in mainhand of <entity>] == [pickaxe_item] )

          /replaceitem entity @s weapon.mainhand [sword_item id]

 end

Last seen on 16:56, 21. Nov 2020
Joined Oct 2018
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
But how can i do this with…
Sun, 10/25/2020 - 19:04

But how can i do this with custom items?

Last seen on 16:56, 21. Nov 2020
Joined Oct 2018
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
( [item in mainhand of …
Sun, 10/25/2020 - 19:11

( [item in mainhand of <entity>] == [sword_item] ) do

          /replaceitem entity @s weapon.mainhand [pickaxe_item]

How do i do this part?