Topic category: Help with Minecraft modding (Java Edition)
Hello, I want to make an item appear on a block thanks to a command. To do this, I make the block appear and then make the item appear on it and I use the player's coordinates to base the placement of these two elements.
First of all, I want to say that I know that the "Spawn item/gem" block exists and that I can simply use it, the problem is that when it appears, the items make a small random jump (which I did not find clearly in the java code) and therefore the item is not perfectly centered or even on the ground next to the block.
So I don't want to use this technique. So I went for the "/summon item ~ ~ ~ {Item:{id: "mymod:item",Count:1b}}" technique, where I need the player's coordinates.
Therein lies my problem, I can't seem to execute a command that has a variable in it. I tried to fix it by two issues that failed. (I want to say that I don't know java at all)
With the block language: I simply took the "Execute command /" block and then with several "crete text with" blocks hooked up that allow me to form the command (thus giving something very ugly). But this doesn't make the item appear at all.
I then tried to lock the procedure and then modify the java code by modifying the paranthesis, several times but without success: the game tells me an error (modified code or not) of paranthesis at the end of the line.
I have a lot of trouble to understand my error. Thanks for your help.
btw, i take into account the resolution of the code but also a more optimized way to make an item appear perfectly at coordinates, without making it jump.
Found what's wrong, I'm just dumb. Not thnaks for ur help
may i ask how you fixed it
try it yourself but with Create text with it does not work
and looking for a way to fix this