How to transform item in hand?

Started by Erfgs45 on

Topic category: Help with MCreator software

Active 5 years ago
Joined Oct 2018
Points:
698

User statistics:

  • Modifications: 0
  • Forum topics: 3
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 5
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?

Active 5 years ago
Joined Oct 2018
Points:
698

User statistics:

  • Modifications: 0
  • Forum topics: 3
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 5
(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.)

Active 2 years ago
Joined Oct 2019
Points:
814

User statistics:

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

Just execute a command:

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

Active 2 years ago
Joined Oct 2019
Points:
814

User statistics:

  • Modifications: 0
  • Forum topics: 11
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 206
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

Active 5 years ago
Joined Oct 2018
Points:
698

User statistics:

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

But how can i do this with custom items?

Active 5 years ago
Joined Oct 2018
Points:
698

User statistics:

  • Modifications: 0
  • Forum topics: 3
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 5
( [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?

Active 9 months ago
Joined Jan 2021
Points:
859

User statistics:

  • Modifications: 1
  • Forum topics: 41
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 83
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