Difference between revisions of "Research/Interaction Events"
Line 263: | Line 263: | ||
== Data Providers == | == Data Providers == | ||
− | Below are all of the data providers | + | Below are all of the data providers: |
{| class="wikitable sortable" | {| class="wikitable sortable" |
Latest revision as of 02:34, 18 June 2025
Contents
Interaction Events
Below are all of the interaction events:
For each of the interaction events the ID is listed, which is how you uniquely reference the event, if they are NPC related, and a brief description. If they are not NPC related this means that they will not work with NPCs and it is the same as not having an event attached to the NPC interaction.
Event Name | ID | NPC Related? | Added | Description |
---|---|---|---|---|
Right Click Entity | pixelmon:right_click |
Yes | 9.3.0 | Fired when a player right clicks an entity. Only NPC related if the entity is an NPC. |
Left Click Entity | pixelmon:left_click |
Yes | 9.3.0 | Fired when a player left clicks an entity. Only NPC related if the entity is an NPC. |
Hit With PokéBall | pixelmon:hit_with_poke_ball |
Yes | 9.3.0 | Fired when a player throws a pokéball at an entity. Only NPC related if the entity is an NPC. |
Close Dialogue | pixelmon:close_dialogue |
Yes | 9.3.0 | Fired when the player closes a dialogue. Only NPC related if the dialogue was opened by an interaction result from an NPC. |
Close Shop | pixelmon:close_shop |
Yes | 9.3.0 | Fired when the player closes a shop. Only NPC related if the shop was opened by an interaction result from an NPC. |
Shop Item Purchase | pixelmon:shop_purchase_item |
Yes | 9.3.0 | Fired when the player purchases an item from a shop. Only NPC related if the shop was opened by an interaction result from an NPC. |
Relearner Accept | pixelmon:relearner_accept |
Yes | 9.3.0 | Fired when the player accepts relearning a move in a relearner UI. Only NPC related if the shop was opened by an interaction result from an NPC. |
Relearner Close | pixelmon:relearner_close |
Yes | 9.3.0 | Fired when the player closes the move relearner UI without relearning moves. Only NPC related if the shop was opened by an interaction result from an NPC. |
Tutor Accept | pixelmon:tutor_accept |
Yes | 9.3.0 | Fired when the player accepts a move from the move tutor. Only NPC related if the tutor UI was opened by an interaction result from an NPC. |
Tutor Close | pixelmon:tutor_close |
Yes | 9.3.0 | Fired when the player closes the move tutor UI without purchasing moves. Only NPC related if the tutor UI was opened by an interaction result from an NPC. |
Select Starter | pixelmon:select_starter |
No | 9.3.0 | Fired when the player chooses a starter from the starter selection UI. |
First Join | pixelmon:first_join |
No | 9.3.0 | Fired when the player first joins the world/server. |
Join | pixelmon:join |
No | 9.3.0 | Fired when the player joins (logs in) to the world/server. |
Craft Item | pixelmon:craft_item |
No | 9.3.0 | Fired when the player crafts an item in the crafting table. |
Fill Shrine Orb | pixelmon:fill_shrine_orb |
No | 9.3.0 | Fired when the player completely fills a shrine orb in their inventory. |
Find Structure | pixelmon:find_structure |
No | 9.3.0 | Fired when the player is inside a structure (fired every tick the player is inside). |
Activate Shrine | pixelmon:activate_shrine |
No | 9.3.0 | Fired when a player right clicks a shrine block and spawns a legendary Pokémon. |
Enter Wild Battle | pixelmon:enter_wild_battle |
No | 9.3.0 | Fired when the player enters a battle with a wild Pokémon opponent. |
Capture Pokémon | pixelmon:capture_pokemon |
No | 9.3.0 | Fired when the player captures a Pokémon. |
Pick Up Item | pixelmon:pick_up_item |
No | 9.3.0 | Fired when the player picks up a dropped item. |
Pokémon Drop Item | pixelmon:pokemon_drop_item |
No | 9.3.0 | Fired when a Pokémon drops an item for a player (after being knocked out). |
Raid Drop Item | pixelmon:raid_drop_item |
No | 9.3.0 | Fired when a raid drops an item for a player (after defeat). |
Spin PokéStop | pixelmon:spin_pokestop |
No | 9.3.0 | Fired when a player spins a PokéStop. |
Release Pokémon | pixelmon:release_pokemon |
No | 9.3.0 | Fired when a player releases a pokémon from their PC. |
Hatch Egg | pixelmon:hatch_egg |
No | 9.3.0 | Fired when a player hatches a pokémon egg. |
Use Lure | pixelmon:use_lure |
No | 9.3.0 | Fired when a player activates a lure in their inventory. |
Throw PokéBall in Battle | pixelmon:throw_pokeball_in_battle |
No | 9.3.0 | Fired when a player throws a pokéball whilst in a battle. |
Evolve Pokémon | pixelmon:evolve_pokemon |
No | 9.3.0 | Fired when a pokémon in the player's party evolves. |
Defeat Raid | pixelmon:defeat_raid |
No | 9.3.0 | Fired when a player beats a raid. |
Defeat Gym NPC | pixelmon:defeat_gym_npc |
No | 9.3.0 | Fired when a player defeats a gym NPC in battle. |
PokéDex Pokémon | pixelmon:pokedex_pokemon |
No | 9.3.0 | Fired when the player sees/captures a new Pokémon, updating their pokédex. |
Mega Evolve | pixelmon:mega_evolve |
No | 9.3.0 | Fired when the player mega evolves one of their pokémon. |
Ultra Burst | pixelmon:ultra_burst |
No | 9.3.0 | Fired when the player ultra bursts one of their pokémon. |
Use Battle Item | pixelmon:use_battle_item |
No | 9.3.0 | Fired when the player uses an item in battle (like a revive). |
Dynamax | pixelmon:dynamax |
No | 9.3.0 | Fired when the player dynamaxes one of their pokémon. |
Gigantamax | pixelmon:gigantamax |
No | 9.3.0 | Fired when the player gigantamaxes one of their pokémon. |
Level Pokémon | pixelmon:level_pokemon |
No | 9.3.0 | Fired when the player levels up one of their pokémon. |
Break Block | pixelmon:break_block |
No | 9.3.0 | Fired when the player breaks a block in the world. |
Knockout Pokémon | pixelmon:knockout_pokemon |
No | 9.3.0 | Fired when the player KOs another pokémon in battle. |
Pick Apricorn | pixelmon:pick_apricorn |
No | 9.3.0 | Fired when the player harvests an apricorn from an apricorn leaf block. |
Pick Berry | pixelmon:pick_berry |
No | 9.3.0 | Fired when the player harvests a berry from a berry leaf block. |
Harvest Crop | pixelmon:harvest_crop |
No | 9.3.0 | Fired when the player harvests any Minecraft crop block (wheat, carrots, etc). |
Change Dimensions | pixelmon:change_dimensions |
No | 9.3.0 | Fired when the player changes dimension (i.e. going to the nether). |
Trade Pokémon | pixelmon:trade_pokemon |
No | 9.3.0 | Fired when the player trades a pokémon with another player or NPC. |
Open Gift | pixelmon:open_gift |
No | 9.3.0 | Fired when the player opens a gift item. |
Player Tick | pixelmon:player_tick |
No | 9.3.0 | Fired every tick the player is on the server. Warning: Can cause lag if overused. |
Eat Cake | pixelmon:eat_cake |
No | 9.3.0 | Fired when the player right clicks a cake block and consumes it. |
Shrine Orb Fill | pixelmon:shrine_orb_fill |
No | 9.3.0 | Fired when filling shrine orbs (Orb of Frozen Souls, Fiery Souls, Static Souls) |
Lure Activate | pixelmon:lure_activate |
No | 9.3.0 | Fired when activating a lure by placing in inventory slot |
Player Cake Eat | pixelmon:player_cake_eat |
No | 9.3.0 | Fired when player right-clicks and eats cake |
Research Events
These events are specific to the Research system :
Event Name | ID | Added | Description |
---|---|---|---|
Research Start | pixelmon:research_start |
9.3.0 | Fired when player starts new Research |
Research Stage Complete | pixelmon:research_stage_complete |
9.3.0 | Fired when completing a Research stage |
Research Discard | pixelmon:research_discard |
9.3.0 | Fired when discarding Research via UI |
Research Complete | pixelmon:research_complete |
9.3.0 | Fired when completing entire Research |
Progress Research Stage | pixelmon:progress_research_stage |
9.3.0 | Fired when progressing Research stages |
Progress Research Objective | pixelmon:progress_research_objective |
9.3.0 | Fired when making objective progress |
Claim Research Stage | pixelmon:claim_research_stage |
9.3.0 | Fired when claiming stage rewards |
Claim Research Objective | pixelmon:claim_research_objective |
9.3.0 | Fired when claiming objective rewards |
Interaction Conditions
Below are all of the interaction conditions:
With each InteractionCondition the parameters are also listed, with the type expected for each parameter and a brief description of how the condition works.
Condition Name | ID | Parameters | Description |
---|---|---|---|
True | pixelmon:true |
None | Always returns true |
False | pixelmon:false |
None | Always returns false |
Logical AND | pixelmon:logical_and |
conditions - Boolean Data Provider List |
Checks that all conditions in the list are true |
Logical OR | pixelmon:logical_or |
conditions - Boolean Data Provider List |
Checks that at least one condition is true |
Logical NOT | pixelmon:logical_not |
condition - Boolean Data Provider |
Checks that the condition is false |
Logical XOR | pixelmon:logical_xor |
conditions - Boolean Data Provider List |
True if exactly one condition is true |
Logical NOR | pixelmon:logical_nor |
conditions - Boolean Data Provider List |
True if all conditions have same value |
Logical NAND | pixelmon:logical_nand |
conditions - Boolean Data Provider List |
Inverted version of logical AND |
Greater Than | pixelmon:greater_than |
min - Number Data Providervalue - Number Data Provider |
Checks value > min |
Greater Than Or Equal | pixelmon:greater_than_or_equal |
min - Number Data Providervalue - Number Data Provider |
Checks value ≥ min |
Less Than | pixelmon:less_than |
max - Number Data Providervalue - Number Data Provider |
Checks value < max |
Less Than Or Equal | pixelmon:less_than_or_equal |
max - Number Data Providervalue - Number Data Provider |
Checks value ≤ max |
Equal | pixelmon:equal |
first - Number Data Providersecond - Number Data Provider |
Checks first == second |
Not Equal | pixelmon:not_equal |
first - Number Data Providersecond - Number Data Provider |
Checks first ≠ second |
In Range (Inclusive) | pixelmon:in_range_inclusive |
min - Number Data Providermax - Number Data Providervalue - Number Data Provider |
Checks value ∈ [min, max] |
In Range (Exclusive) | pixelmon:in_range_exclusive |
min - Number Data Providermax - Number Data Providervalue - Number Data Provider |
Checks value ∈ (min, max) |
Number List Contains | pixelmon:number_list_contains |
value - Number Data Providerlist - Number Data Provider List |
Checks value is in list |
String Compare | pixelmon:string_compare |
first - String Data Providersecond - String Data Provider |
Case-sensitive string equality |
String Compare (Case Insensitive) | pixelmon:string_compare_case_insensitive |
first - String Data Providersecond - String Data Provider |
Case-insensitive string equality |
String Contains | pixelmon:string_contains |
text - String Data Providersub_text - String Data Provider |
Checks if sub_text is in text |
String List Contains | pixelmon:string_list_contains |
value - String Data Providerlist - String Data Provider List |
Checks string is in list |
Items Equal | pixelmon:items_equal |
first - ItemStack Data Providersecond - ItemStack Data Provider |
Checks itemstack equality |
Item Is One Of | pixelmon:item_is_one_of |
items - Item list/tagitem - ItemStack Data Provider |
Checks item is in list/tag |
Block Is One Of | pixelmon:block_is_one_of |
blocks - Block list/tagblock - BlockState Data Provider |
Checks block is in list/tag |
Contains Item | pixelmon:contains_item |
items - ItemStack Data Provider Listitem - ItemStack Data Provider |
Checks item is in list |
Item Tags Match | pixelmon:item_tags_match |
first - ItemStack Data Providersecond - ItemStack Data Provider |
Checks NBT tag equality |
Random Chance | pixelmon:random_chance |
chance - Number ∈ [0,1] |
Random number ≤ chance |
Recipe Matches | pixelmon:recipe_matches |
recipe - Resource Location |
Checks recipe matches context |
Structure is one of | pixelmon:structure_is_one_of |
structures - Resource Location List |
Checks structure matches context |
Spec Matches | pixelmon:spec_matches |
spec - String Data Providerpokemon - Pokemon Data Provider |
Checks Pokémon matches spec |
Month Is | pixelmon:month_is |
month - String Data Provider |
Checks current month name |
Item Has Tag | pixelmon:item_has_tag |
item - ItemStack Data Providertag - String Data Provider |
Checks item has tag key |
Interaction Results
Below are all of the interaction results:
Result Name | ID | Parameters | Description |
---|---|---|---|
Player Execute Command | pixelmon:player_execute_command |
commands - String List |
Forces player to execute commands |
Console Execute Command | pixelmon:console_execute_command |
commands - String List |
Executes commands as console |
Give Item | pixelmon:give_item |
items - ItemStack List |
Gives player items from list |
Give Pokémon | pixelmon:give_pokemon |
pokemon - Spec List |
Gives player Pokémon from specs |
Trigger Interaction Event | pixelmon:trigger_interaction_event |
event - Interaction Event |
Triggers another interaction event |
Player Start NPC Battle | pixelmon:player_start_npc_battle |
None | Starts battle between player and NPC |
Empty | pixelmon:empty |
None | Does nothing |
Message Player | pixelmon:message_player |
messages - Component List |
Sends messages to player |
Heal Player | pixelmon:heal_player |
require_healer_block - Boolean |
Heals player's party |
Set Icon | pixelmon:set_icon |
icon - Resource With Fallback |
Sets NPC icon for player |
Open Trade | pixelmon:open_trade |
required - Specgiven - Spec |
Opens trader GUI |
Open Shop | pixelmon:open_shop |
sellable - Booleanitems - Shop Item List |
Opens shop UI |
Open Dialogue | pixelmon:open_dialogue |
title - Stringmessage - Stringfire_close_event - Boolean |
Opens dialogue UI |
Open Paged Dialogue | pixelmon:open_paged_dialogue |
title - Stringpages - String List |
Opens multi-page dialogue |
Appraise Rod | pixelmon:appraise_rod |
title - String |
Calls rod appraisal |
Relearn Move | pixelmon:relearn_move |
cost - ItemStack |
Opens move relearner |
Tutor Move | pixelmon:tutor_move |
learnable_moves - Move List |
Opens move tutor |
Give Experience | pixelmon:give_experience |
exp - Integer |
Gives player XP |
Give Money | pixelmon:give_money |
money - Double |
Gives player money |
Spawn And Enter Battle | pixelmon:spawn_and_enter_battle |
spec - Spec |
Spawns Pokémon and starts battle |
Give Loot Table | pixelmon:give_loot_table |
loot_table - Resource Location |
Gives loot table items |
Data Providers
Below are all of the data providers:
Provider Name | ID | Type | Parameters | Description |
---|---|---|---|---|
Party Slot | pixelmon:party_slot |
Pokémon | slot - Integer |
Gets Pokémon in party slot |
Player EXP Level | pixelmon:player_exp_level |
Number | None | Gets player's XP level |
Constant Number | pixelmon:constant_number |
Number | value - Number |
Returns constant number |
Constant Boolean | pixelmon:constant_boolean |
Boolean | value - Boolean |
Returns constant boolean |
Constant String | pixelmon:constant_string |
String | value - String |
Returns constant string |
Constant ItemStack | pixelmon:constant_itemstack |
ItemStack | value - ItemStack |
Returns constant item |
Context Item | pixelmon:context_item |
ItemStack | None | Gets item from context |
Constant Block State | pixelmon:constant_block_state |
BlockState | value - BlockState |
Returns constant block |
Context Block State | pixelmon:context_block_state |
BlockState | None | Gets block from context |
Interaction Condition | pixelmon:interaction_condition |
Boolean | condition - Condition |
Evaluates condition |
Pokémon Matches | pixelmon:pokemon_matches |
Boolean | pokemon - Pokémonspec - Spec |
Checks Pokémon matches spec |
Has Permission | pixelmon:has_permission |
Boolean | permission - ResourceLocation |
Checks player permission |
Player Name | pixelmon:player_name |
String | None | Gets player name |
Player UUID | pixelmon:player_uuid |
String | None | Gets player UUID |
Player IP | pixelmon:player_ip |
String | None | Gets player IP |
Player Game Mode | pixelmon:player_game_mode |
String | None | Gets player gamemode |
Player Inventory | pixelmon:player_inventory |
ItemStack List | None | Gets player inventory |
Hand Used | pixelmon:hand_used |
String | None | Gets interaction hand |
PokéDex | pixelmon:pokedex |
Number | None | Gets caught Pokémon count |
Pokémon Level | pixelmon:pokemon_level |
Number | None | Gets Pokémon level |
Context Pokémon | pixelmon:context_pokemon |
Pokémon | key - ResourceLocation |
Gets Pokémon from context |
Integer Context | pixelmon:context_integer |
Number | key - ResourceLocation |
Gets number from context |
String Context | pixelmon:context_string |
String | key - ResourceLocation |
Gets string from context |
Day of Month | pixelmon:day_of_month |
Number | None | Gets current day |
Player Armor | pixelmon:player_armor |
ItemStack | slot - String |
Gets armor item |
Context Keys
The context is how data is passed along the interaction pipeline. It is a temporary, impermanent store of information that may later be used for different purposes in the interaction pipeline.
Key ID | Type | Description |
---|---|---|
pixelmon:npc |
NPC | Relevant NPC |
pixelmon:player |
Player | Relevant player |
pixelmon:hand |
InteractionHand | Hand used in interaction |
pixelmon:level |
Level | World interaction occurred in |
pixelmon:position |
Vec3 | Position of interaction |
pixelmon:main_hand |
ItemStack | Main hand item |
pixelmon:off_hand |
ItemStack | Off hand item |
pixelmon:helmet |
ItemStack | Helmet slot item |
pixelmon:chestplate |
ItemStack | Chestplate slot item |
pixelmon:leggings |
ItemStack | Leggings slot item |
pixelmon:boots |
ItemStack | Boots slot item |
pixelmon:recipe |
ResourceLocation | Recipe ID used |
pixelmon:item |
ItemStack | Relevant item |
pixelmon:structure |
Structure | Relevant structure |
pixelmon:pokemon |
Pokémon | Relevant Pokémon |
pixelmon:block |
BlockState | Relevant block |
pixelmon:block_pos |
BlockPos | Block position |
pixelmon:stars |
Integer | Raid star level |
pixelmon:dimension_from |
String | Origin dimension |
pixelmon:dimension_to |
String | Destination dimension |
pixelmon:given_pokemon |
Pokémon | Given Pokémon |
pixelmon:received_pokemon |
Pokémon | Received Pokémon |
pixelmon:biome |
String | Current biome ID |
pixelmon:dimension |
String | Current dimension ID |
pixelmon:pokeball |
String | Pokéball type used |
Developer Notes
Research API
Research has been given its own storage system to separate the data from the player's party, pokédex, and PC. This prevents data loss through corruption and keeps the party storage API clean.
Research Access
Access player research through the ResearchStorageProxy
static class, similar to accessing a player's party.
Key interfaces:
ResearchStorage
- Access/modify Research dataPlayerResearch
- Player-specific Research progressPlayerResearchObjective
/PlayerResearchStage
- Track objective/stage progress
Storage Loading/Saving
Research uses custom saving/loading implementations. Modify these through the PixelmonInitEvent
.
The thread pool in the save scheduler handles interaction pipeline calls to prevent server lag.
Event Deletions
Removed events from old Quest system:
AbandonQuestEvent
FinishQuestEvent
NPCInserterEvent
QuestActionEvent
QuestObjectiveEvent
QuestStageEvent