Carpet

Carpet

2M Downloads

Suggestion: Event handlers for advancement and recipe unlocks

James103 opened this issue ยท 1 comments

commented

I would like it if there were the following new event handlers, so Scarpet apps can do something when a player gains an advancement or unlocks a recipe for example, without having to check all recipes and advancements of all players every tick (which would be very computationally expensive).

  • __on_new_advancement(player, advancement, type) (Called when a player makes an advancement. type can be one of normal, goal, or challenge, while advancement is the full advancement name (namespace:name). If the advancement is revoked on unlock from within its event handler, the toast does not show up.)
  • __on_new_recipe(player, recipe, type) (Called when a player unlocks a new recipe. type refers to the where the recipe is crafted (crafting table, furnace, smoker, campfire, stonecutter, etc), while recipe refers to the full recipe name (namespace:name). If the recipe is revoked on unlock from within its event handler, the toast does not show up.)
commented

sounds good. Technically these can are all tracked via statistics, right? But it would be handy to track it as it might be cheaper to handle