EndstoneMC / endstone

Endstone - High-level Plugin API for Modding Bedrock Dedicated Servers (BDS), in both Python and C++.
http://endstone.dev/
Apache License 2.0
236 stars 22 forks source link

[bug] Command sender should be player when using `Player::performCommand` #53

Closed wu-vincent closed 2 weeks ago

wu-vincent commented 2 weeks ago

Describe the bug When a plugin uses Player::performCommand to run a plugin command, the command executor is called with a generic CommandSender object instead of Player. This is due to the current implementation of Player::performCommand using VirtualCommandOrigin to execute the command, which is not correctly converted to Player upon callback.

To Reproduce

  1. Add a new plugin command
  2. Call Player::performCommand to run that plugin command
  3. Check the type of sender in onCommand callback.

Expected behavior The type of sender should be Player.