New answers tagged

0

I threw some math at this, which could maybe give you something towards an approximation, but TBH the result is somewhat disappointing, perhaps because I'm not really sure what space the initial values are supposed to be in: We can simply take the movement component values (ignoring gravity) from the values you've gotten and calculate the speed of the player ...


1

It's really easy to call your function twice each tick, but that's calling it twice every 20th of a second, not once every 60th of a second which is what you seem to want. Without wading into multithreading and worrying about API access and thread-safe interactions in your code, you're not going to be able to get this behavior without increasing the tick ...


0

Use the AttackEntityEvent instead. Here's an example: @SubscribeEvent public void onPlayerAttack(AttackEntityEvent event) { PlayerEntity attacker = event.getPlayer(); Entity target = event.getTarget(); } Hope this helps!


1

Slow down your progress. Let it take more than 1 tick (if I'm reading your situation right). For example, when starting the transition - choose the desired tick duration (e.g. tickDuration = 10 ticks) and store the startedOnTick. Now in the lerp you can lerp with the progress = (currentTick + elapsedPartialTicks - startedOnTick) / tickDuration. This way you ...


Top 50 recent answers are included