if right clicked on a specific entity with item remove the item and give a other item

Started by AntekGames2013 on

Topic category: Help with modding (Java Edition)

Last seen on 12:17, 23. May 2024
Joined Sep 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
if right clicked on a specific entity with item remove the item and give a other item

i though il just do

 

if | is event target entity of sub type

do | remove 1 item from target inventory

      | add 1 item to target inventory

 

but it didnt work, i put the procedure in the items procedures.

can anyone help?

 

Last seen on 02:33, 2. Jul 2024
Joined Jun 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I'm looking for exactly the…
Tue, 07/02/2024 - 02:00


I'm looking for exactly the same thing, but nothing and in the forums on this page almost no one ever answers

Last seen on 20:41, 3. Jul 2024
Joined Jun 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
https://i.imgur.com/cxkEQak…
Tue, 07/02/2024 - 02:43

https://i.imgur.com/cxkEQak.png

You can probably edit it to remove 1 of the item from the main hand instead of the inventory using "shrink" or something but this does work as well. From memory though it might remove 1 of that item that is in the first slot (closest to the left of the hotbar not sure)

I made this is 2023.1 but I can not see why it would not still work.

Last seen on 03:28, 4. Jul 2024
Joined Jul 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
This is the how i did it. i…
Thu, 07/04/2024 - 03:25

This is the how i did it. 
i put sounds and particles, cause is an item from my mod, but you can just don't put these blocks

https://imgur.com/a/74LzrfE