Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed vertical knock back not matching vanilla #5986

Open
wants to merge 2 commits into
base: stable
Choose a base branch
from

Conversation

JavierLeon9966
Copy link
Contributor

Introduction

I tested the knockback in a vanilla server using gophertunnel by logging the output of SetActorMotionPacket and it turns out the player has a vertical knockback limit of 0.3608.

Relevant issues

None

Changes

API changes

None

Behavioural changes

None

Backwards compatibility

None

Follow-up

None

Tests

<?php

declare(strict_types=1);

namespace JavierLeon9966\KBTest;

use pocketmine\event\EventPriority;
use pocketmine\event\player\PlayerItemUseEvent;
use pocketmine\plugin\PluginBase;

class Main extends PluginBase{

	protected function onEnable(): void{
		$this->getServer()->getPluginManager()->registerEvent(PlayerItemUseEvent::class, function(PlayerItemUseEvent $event): void{
			$event->getPlayer()->knockBack(lcg_value() * 2 - 1, lcg_value() * 2 - 1);
		}, EventPriority::MONITOR, $this);
	}
}
Screen_Recording_20230810_154530_Minecraft.mp4

@IvanCraft623
Copy link
Member

Are you sure this isn't a randomized value?

@JavierLeon9966
Copy link
Contributor Author

Are you sure this isn't a randomized value?

Yes. I tested multiple times and that value was always logged.

@ItsZodiaX
Copy link
Contributor

dragonfly also use this value.

@dktapps
Copy link
Member

dktapps commented Aug 15, 2023

I feel like there's some physics that we're missing here. Java uses 0.4, and Bedrock mimics Java in this regard.

@ShockedPlot7560 ShockedPlot7560 added Category: Gameplay Related to Minecraft gameplay experience Type: Fix Bug fix, typo fix, or any other fix labels Aug 28, 2023
@dktapps dktapps added the Type: Workaround Duct tape for a bug to remove a symptom label Nov 29, 2024
@dktapps dktapps requested a review from a team as a code owner December 12, 2024 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Gameplay Related to Minecraft gameplay experience Type: Fix Bug fix, typo fix, or any other fix Type: Workaround Duct tape for a bug to remove a symptom
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants