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

Implemented vanilla /xp command. #6429

Merged
merged 14 commits into from
Nov 15, 2024
Merged

Implemented vanilla /xp command. #6429

merged 14 commits into from
Nov 15, 2024

Conversation

ipad54
Copy link
Member

@ipad54 ipad54 commented Aug 17, 2024

Introduction

This PR implements /xp command from vanilla. Also, I think it would be convenient to have a built-in command that can give you experience levels to test enchanting tables / anvils instead of farming experience from bottles.

Changes

API changes

Added XpCommand
Added 2 new permissions:

  • pocketmine.command.xp.other
  • pocketmine.command.xp.self

Follow-up

Before accepting this PR you need to add new translations into pmmp/Language repo

See pmmp/Language#185

Requires translations:

| pocketmine.command.xp.description | Adds or removes player experience |

| pocketmine.permission.command.xp.other | Allows the user to add or remove experience of other players |
| pocketmine.permission.command.xp.self | Allows the user to add or remove their experience |
| pocketmine.command.xp.usage | /xp <experience[L]> [player] |

| commands.xp.failure.widthdrawXp | Cannot give player negative experience points |
| commands.xp.success | Gave {%0} experience to {%1} |
| commands.xp.success.levels | Gave {%0} experience levels to {%1} |
| commands.xp.success.negative.levels | Taken {%0} levels from {%1} |

Tests

I tested this PR by doing the following:

  • Playtesting using a Minecraft client
    Screenshot_20240817_143222

src/command/defaults/ExperienceCommand.php Outdated Show resolved Hide resolved
src/command/defaults/ExperienceCommand.php Outdated Show resolved Hide resolved
src/command/defaults/ExperienceCommand.php Outdated Show resolved Hide resolved
src/command/defaults/ExperienceCommand.php Outdated Show resolved Hide resolved
src/command/defaults/ExperienceCommand.php Outdated Show resolved Hide resolved
src/command/defaults/ExperienceCommand.php Outdated Show resolved Hide resolved
@ShockedPlot7560 ShockedPlot7560 added Category: Gameplay Related to Minecraft gameplay experience Type: Enhancement Contributes features or other improvements to PocketMine-MP labels Aug 19, 2024
@dktapps dktapps added the Status: Blocked Depends on other changes which are yet to be completed label Nov 14, 2024
@dktapps
Copy link
Member

dktapps commented Nov 14, 2024

Translations are available as of 2d9cee3

@dktapps dktapps added Status: Waiting on Author and removed Status: Blocked Depends on other changes which are yet to be completed labels Nov 14, 2024
@ipad54 ipad54 requested a review from a team as a code owner November 15, 2024 10:48
github-actions[bot]
github-actions bot previously approved these changes Nov 15, 2024
@dktapps dktapps merged commit a75d468 into pmmp:minor-next Nov 15, 2024
15 checks passed
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: Enhancement Contributes features or other improvements to PocketMine-MP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants