Started by
GendarmyY
on
Topic category: Help with MCreator software
I've created this procedure for an item I've also created:
[link does'nt work anymore]
As you can see, I've made an item that when you right click on a mob with it, it give them slowness and plays a sound, but also remove 1 of this item of the player inventory so that it looks like you used the item and now it broked. The problem is, it actually removes 2 items of the inventory and idk why. I've tried to put 0 or 0.5 but it basically removed nothing.
If someone could possibly know the reason of that for happening, it would be really appreciated ! :)
Edited by GendarmyY on Fri, 07/03/2020 - 12:40
The link didn't worked, so I'm going to write the procedure myself:
Event trigger - triggered by external call
or when (global trigger): "Player right clicks on entity"
If: Item in main -hand of [Source entity] = (the item I've created)
do: Add potion with level [250] duration [20] ambient [false] to [Event/target entity] type [SLOWNESS]
Play at x y z level: [0.7] pitch: [1] sound: (my custom sound)
Remove [1] (the item I've created) from [Source Entity] inventory
Right click procedures trigger twice. So, in order to fix this, click on the "template library" text, (above the procedure types) and scroll to the bottom, and you will find this: "Strike lightning each 10th time procedure is called". Click on it, and you will get the procedure stuff. Change all the 10 to 2, and remove the strike lightning stuff, and place your custom procedure there.
Do I need the "remove 1 item from inventory" procedure or I can just delete it ?
You need it.
It worked ! Thank you really much ! :)
2020.4:
it still deletes 2 instead of 1