Started by
Rislir
on
Topic category: Help with Minecraft modding (Java Edition)
Hi.
I want to make a mod that will drop a certain amount of currency from any monster (I'm using diamonds as an example). I can't find a way to specify the number of diamonds. For example, in the first case, I want to drop 2 diamonds. How can I do this?
You could create a local itemstack variable, set it to a diamond, then set the count of the itemstack variable to 2, then drop the variable (this method also allows you to drop items with enchantments or some durability damage).
Alternatively, you could just duplicate the spawn dropped item block and have two of them for two diamonds (this is probably a slightly quicker and easier option, but less effective, and the first one doesn't really take that much time anyways).
Technically, you could also use a 'repeat' procedure block, but for dropping two of an item, you really don't need it, and for dropping lots of items, the first method is better anyways.
I'm trying 1 option.
I found how to set itemstack... But i cant find, how to set count of the itemstack variable((
Can you show me an example like that? Thanks!
There is a procedure block under "Item procedures" -> "Actions" called "Set number of items in [Provided itemstack] to [64]" you can swap out [provided itemstack] for the variable, and [64] for 2.
(it is the third procedure block from the top in Item procedures -> Actions)