{ "_fv": 57, "_type": "procedure", "definition": { "procedurexml": "rxryplayer_ticksfloat recoilx = ((float)(entity instanceof LivingEntity _livEnt ? _livEnt.getMainHandItem() : ItemStack.EMPTY).getOrCreateTag().getDouble(\"recoilx\"));&#10;float recoily = ((float)(entity instanceof LivingEntity _livEnt ? _livEnt.getMainHandItem() : ItemStack.EMPTY).getOrCreateTag().getDouble(\"recoily\"));ANDANDGTE1CUSTOM:Pronelocal:rx1.2local:ry0.8CUSTOM:ProneEQbipod1local:rx5local:ry0.1local:rx1.4local:ry0.7local:rx1local:ry1GTglobal:recoil0global:recoilADDglobal:recoil0.01GTEglobal:recoil1global:recoil0MINUSMULTIPLY0.1ADDSINMULTIPLYMULTIPLY2PIMINUSglobal:recoil0.08333333333330.5double[] recoilTimer = {0};&#10;double totalTime = 100;&#10;int sleepTime = 2;&#10;double recoilDuration = totalTime / sleepTime;&#10;float speed = (float) ((Math.random() * 2) - 1) / recoilx;&#10;Runnable recoilRunnable = () -> {&#10;&#10;while (recoilTimer[0] < recoilDuration) {&#10;&#10;float newPitch = entity.getXRot() - recoily;&#10;float newYaw = entity.getYRot() - speed;&#10;entity.setYRot(newYaw);&#10;entity.setXRot(newPitch);&#10;entity.yRotO = entity.getYRot();&#10;entity.xRotO = entity.getXRot();&#10;recoilTimer[0]++;&#10;try {&#10;Thread.sleep(sleepTime);&#10;} catch (InterruptedException e) {&#10;e.printStackTrace();&#10;}&#10;}&#10;&#10;while (recoilTimer[0] > 0) {&#10;float newPitch = entity.getXRot() + recoily;&#10;float newYaw = entity.getYRot() + speed;&#10;entity.setXRot(newPitch);&#10;entity.setYRot(newYaw);&#10;entity.xRotO = entity.getXRot();&#10;entity.yRotO = entity.getYRot();&#10;recoilTimer[0]--; &#10;try {&#10;Thread.sleep(sleepTime);&#10;} catch (InterruptedException e) {&#10;e.printStackTrace();&#10;}&#10;}&#10;};&#10;Thread recoilThread = new Thread(recoilRunnable);&#10;recoilThread.start();" } }