Started by
Kisonix
on
Topic category: Help with Minecraft modding (Java Edition)
I just can't understand why? It doesn't work.
After all, according to LOGIC, everything is done correctly.
Screenshot - https://imgur.com/RpLmRqI
I need that when passing through a block of arable land, if there are no other blocks above the arable land and the player has a stone in his inventory, then a block of stone is placed on the block of arable land.
But for some reason the logic does not work.
what triggers this?
Updating the entity tick.
The entity is a 3D model of a tractor that you can drive and plant crops if there are seeds in the tractor’s internal inventory. - That's the basic idea of logic.
And I still managed to make it so that the check for the presence of an item in the entity's inventory worked.
But now there is the next problem.
I need that after the entity's tick is updated, the item disappears from the internal inventory of the entity one by one. For example, I put 64 items and after I drove my entity (tractor) across the field, it sowed the field with seeds and one item (seed) should disappear from the inventory of the entity.
New screenshot - https://imgur.com/1RgZCYd
didn't this block do that?
Unfortunately no, this block refers to the player, and if it is applied to an entity, for some reason it does not work.
Oh huh, I see
Ig you have to do something like this,

That might not work since it's "get contents copy as" if so try,

Your last option worked, but for some reason if I have 1 item in my inventory slot, and when I sow the arable land, it is sown not once but twice, and in survival 4 beds were sown... o_0.
Image: https://imgur.com/a/SZhelyc
um...
How many slots does the entity have?
The entity has 1 slots.
For example, there are 3 items in the entity's inventory.
When I walk on one block of arable land, 2 items out of 3 are spent, not 1. This is strange.
try doing just this without big for each then

The it taking multiple items could also be caused by, both the server and the client taking an item,
It's very strange, if there is 1 item in the inventory cell, then it plants 2 fields.
And if there are 3 items, then all 6 fields.
hmm. Both server and client, maybe I'll try to export the mod and try it on minecraft without Mcreator.
I tried it on pure minecraft and unfortunately the item count doesn't work.
If there are 2 items in the slot, it plants 4.
And if there are 3 items, it plants 6.
Hmm, I don't understand why it multiplies...
If you use a block: If / not / Is provided world client-side.
Even if there is one item in the inventory cell, the imprisonment can be eternal until I stop the entity. o_0