Paper icon indicating copy to clipboard operation
Paper copied to clipboard

add PlayerCreateMapEvent

Open chmodsayshello opened this issue 2 years ago • 2 comments

This small pull request adds an event that gets fired whenever a player creates a map...

Merging this PR would result in #9073 being resolved

chmodsayshello avatar May 02 '23 18:05 chmodsayshello

force pushed in order to change misleading commit message

chmodsayshello avatar May 02 '23 18:05 chmodsayshello

Would probably also be nice to include the original item stack here seeing as it's easily accessible? Then you could cancel the event depending on that too (e.g. for custom empty map items that can only be used in specific places) instead of having to try to get the correct empty map item from the player's inventory manually.

Phoenix616 avatar May 07 '23 16:05 Phoenix616

Isn't it more a PlayerInitializeMapEvent? Creating is basically crafting for me.

yannicklamprecht avatar Nov 01 '23 11:11 yannicklamprecht

Well, using "initialize' for that event might be confusing seeing as the map loading by the server on startup is called that too and describes a completely different behaviour.

"Create" sounds correct for me as a new map (as in the MapView, not as in an ItemStack with the kinda arbitrary type "map") is created on the server. Don't see it getting confused with crafting either, seeing as it would just use "CraftEvent" like the others if that was what the event refers too.

Phoenix616 avatar Nov 01 '23 11:11 Phoenix616