Started by
Erfgs45
on
Topic category: Help with MCreator software
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?
(BTW with right-click, i mean on ablock, on the air, on an entity, ect.)
Just execute a command:
/replaceitem entity @s weapon.mainhand [item-id]
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
But how can i do this with custom items?
( [item in mainhand of <entity>] == [sword_item] ) do
/replaceitem entity @s weapon.mainhand [pickaxe_item]
How do i do this part?
you can use the /give command to know the ID of you item
the name of the item works like this: yourmodname:youritemname