LiteLDev / LeviLamina

A lightweight, modular and versatile mod loader for Minecraft Bedrock Edition, formerly known as LiteLoaderBDS
https://levimc.org/software/levilamina
GNU Lesser General Public License v3.0
1.14k stars 117 forks source link

MobHurtEvent not changing damage. #812

Closed ghost closed 2 years ago

ghost commented 2 years ago

Exceptions module

Core

Operating System

Windows 11

LiteLoader version

https://github.com/LiteLDev/LiteLoaderBDS/releases/tag/2.6.2

BDS version

1.19.22

What happened?

MobDamageEvent not changing damage to the player. https://youtu.be/CO1v3UYMDmc Same with PlayerAttackEvent

Steps to reproduce?

  1. Write a simple plugin that changes mDamage on Event::MobHurtEvent kartina
  2. Build
  3. Test on player.

Relevant log output

None.

Plugin list

None.
futrime commented 2 years ago

@hausemaster3734 You should use a reference to the event object

RimuruChan commented 2 years ago

Use MobHurtEvent& event to avoid copy.