Spawn entity at coordinates rounding w/o decimals & rotation inaccurate + delayed

Started by riwi0707 on

Topic category: Help with modding (Java Edition)

Last seen on 00:29, 24. Apr 2024
Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Spawn entity at coordinates rounding w/o decimals & rotation inaccurate + delayed
Tue, 04/23/2024 - 23:55 (edited)

My procedure is "when right-clicked (entity pos.)" for an item and using X, Y, and Z coordinates of the event target entity (player) spawn an entity with the yaw rotation of the player as well. In-game, the decimals for the player's coordinates are cut off and rounded to the nearest block with intervals of 1 instead of using the precise decimals as I hoped.

Secondly, the rotation is applied to the entity late rather than instantaneously when spawned and is also inaccurate. The entity is specifically made to prevent itself from rotating, and the slight difference in player rotation to the spawned entity rotation causes the model to face my desired direction, but the entity's actual direction is slightly off, making the model correct the rotation a few seconds after spawning. However, the rotation is applied correctly in roughly 2/3 of instances of the procedure.

This procedure worked as intended before I updated MCreator to 2024.1 (1.20.1 Forge) and the workspace was previously in 2023.2 (1.19.4 Forge)

Edited by riwi0707 on Tue, 04/23/2024 - 23:55