LiteLDev / LegacyScriptEngine

A plugin engine for running LLSE plugins on LeviLamina
https://lse.liteldev.com/
GNU General Public License v3.0
43 stars 8 forks source link

[Bug]: Intercepting onSpawnProjectile reduces the item #143

Closed Caldron47 closed 2 months ago

Caldron47 commented 3 months ago

Describe the bug

When intercepting onSpawnProjectile event, the projectile doesn't get spawned but the number of item gets reduced.

To Reproduce

mc.listen('onSpawnProjectile', function(shooter, type) {
     return false;
});

Throw a trident/snowball/ender pearl/etc. It will be gone or reduced by 1

Expected behavior

I believe the number of item should stay the same if the event is intercepted.

Screenshots

No response

Platform

Windows 10

BDS Version

1.20.81

LeviLamina Version

0.12.3

LegacyScriptEngine Version

0.7.12

Additional context

No response

ShrBox commented 2 months ago

I have fix it for trident. You can block snowball or something else's using by onUseItem from reducing them.