EssentialsX

EssentialsX

2M Downloads

Player kit receive event

JHarris12345 opened this issue ยท 6 comments

commented

Type of bug

Other unexpected behaviour

/ess dump all output

https://essentialsx.net/dump.html?id=cf12c2d98b2c491daa64d77efd567916

Error log (if applicable)

No response

Bug description

So this is a suggestion for JRoy (they asked me to put it here). It was about having a PlayerKitReceiveEvent that is called when a player receives an essentials kit. This event would have a way to get (and modify) all tangible items stacks that they will / might receive from the kit. For example, an e.getItemStacks() method.

The benefit of this would be so plugin developers like myself can modify the items of a kit in much more depth and with a lot more customisation that what is available in the kit itself. For example, I want to be able to add the player's UUID in the PersistentDataContainer of each itemstack in the kit (do not want to use NBT for it) and I feel like this event would be incredibly helpful to customise the kit itemstacks in depth

Steps to reproduce

Not an issue

Expected behaviour

Not an issue

Actual behaviour

Not an issue

commented

Is there any update to the progress on this?

commented

There is a KitClaimEvent but it doesn't support modifications to the items being expanded from the kit. There is also the option to register an ItemResolver with EssentialsX's item database, but this doesn't provide any context about the user that the item is being created for/by.

Ideally I'd like to refactor the item metadata system (along with larger changes to data) to allow plugins to register their own metadata providers, but this will likely happen with larger item handling refactors.

In the meantime I wouldn't be opposed to an event specifically related to expanding kit items, but I'm wary of adding this event and then immediately deprecating it once the proper metadata changes are done.

commented

It would be a great help to have an event that allows us to modify the kit items being given. This would allow me much larger possibilities to prevent certain things with items from essentials kits

commented

What maven dependency version is this event added to?

commented

Got it. Was in the older releases (net.ess3)

commented

What maven dependency version is this event added to?

<repositories>
    ...
    <repository>
        <id>essentials-releases</id>
        <url>https://repo.essentialsx.net/releases/</url>
    </repository>
    <repository>
        <id>paper-repo</id>
        <url>https://papermc.io/repo/repository/maven-public/</url>
    </repository>
</repositories>

<dependencies>
    ...
    <dependency>
        <groupId>net.essentialsx</groupId>
        <artifactId>EssentialsX</artifactId>
        <version>2.20.1-SNAPSHOT</version>
        <scope>provided</scope>
    </dependency>
</dependencies>