Skip to content

Fixed vertical knock back not matching vanilla#5986

Open
JavierLeon9966 wants to merge 2 commits intopmmp:stablefrom
JavierLeon9966:fix-vanilla-vertical-kb
Open

Fixed vertical knock back not matching vanilla#5986
JavierLeon9966 wants to merge 2 commits intopmmp:stablefrom
JavierLeon9966:fix-vanilla-vertical-kb

Conversation

@JavierLeon9966
Copy link
Copy Markdown
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
Copy Markdown
Member

Are you sure this isn't a randomized value?

@JavierLeon9966
Copy link
Copy Markdown
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
Copy Markdown
Contributor

dragonfly also use this value.

@dktapps
Copy link
Copy Markdown
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

Status: No status

Development

Successfully merging this pull request may close these issues.

5 participants