How to transform item in hand?

Started by Erfgs45 on

Topic category: Help with MCreator software

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

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to transform item in hand?

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
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • 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 15:38, 1. Dec 2022
Joined Oct 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • 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 15:38, 1. Dec 2022
Joined Oct 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • 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
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • 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
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • 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?

Last seen on 23:35, 30. Oct 2023
Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
you can use the /give…
Thu, 03/31/2022 - 13:48

you can use the /give command to know the ID of you item

the name of the item works like this: yourmodname:youritemname