From a6bdd221d4e217dce6bb4f1359286bd64c647b52 Mon Sep 17 00:00:00 2001 From: TM-Grant3 <136981990+TM-Grant3@users.noreply.github.com> Date: Wed, 11 Oct 2023 12:48:39 -0400 Subject: [PATCH 1/2] Update index.d.ts --- index.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.d.ts b/index.d.ts index be4fc19f..1c1f17a6 100644 --- a/index.d.ts +++ b/index.d.ts @@ -102,6 +102,7 @@ declare module 'bedrock-protocol' { // # Displays "Wow this server is popular! Check back later to see if space opens up. Server Full" | 'failed_server_full' + export type Packets = "login" | "play_status" | "server_to_client_handshake" | "client_to_server_handshake" | "disconnect" | "resource_packs_info" | "resource_pack_stack" | "resource_pack_client_response" | "text" | "set_time" | "start_game" | "add_player" | "add_entity" | "remove_entity" | "add_item_entity" | "take_item_entity" | "move_entity" | "move_player" | "rider_jump" | "update_block" | "add_painting" | "tick_sync" | "level_sound_event_old" | "level_event" | "block_event" | "entity_event" | "mob_effect" | "update_attributes" | "inventory_transaction" | "mob_equipment" | "mob_armor_equipment" | "interact" | "block_pick_request" | "entity_pick_request" | "player_action" | "hurt_armor" | "set_entity_data" | "set_entity_motion" | "set_entity_link" | "set_health" | "set_spawn_position" | "animate" | "respawn" | "container_open" | "container_close" | "player_hotbar" | "inventory_content" | "inventory_slot" | "container_set_data" | "crafting_data" | "crafting_event" | "gui_data_pick_item" | "adventure_settings" | "block_entity_data" | "player_input" | "level_chunk" | "set_commands_enabled" | "set_difficulty" | "change_dimension" | "set_player_game_type" | "player_list" | "simple_event" | "event" | "spawn_experience_orb" | "clientbound_map_item_data" | "map_info_request" | "request_chunk_radius" | "chunk_radius_update" | "item_frame_drop_item" | "game_rules_changed" | "camera" | "boss_event" | "show_credits" | "available_commands" | "command_request" | "command_block_update" | "command_output" | "update_trade" | "update_equipment" | "resource_pack_data_info" | "resource_pack_chunk_data" | "resource_pack_chunk_request" | "transfer" | "play_sound" | "stop_sound" | "set_title" | "add_behavior_tree" | "structure_block_update" | "show_store_offer" | "purchase_receipt" | "player_skin" | "sub_client_login" | "initiate_web_socket_connection" | "set_last_hurt_by" | "book_edit" | "npc_request" | "photo_transfer" | "modal_form_request" | "modal_form_response" | "server_settings_request" | "server_settings_response" | "show_profile" | "set_default_game_type" | "remove_objective" | "set_display_objective" | "set_score" | "lab_table" | "update_block_synced" | "move_entity_delta" | "set_scoreboard_identity" | "set_local_player_as_initialized" | "update_soft_enum" | "network_stack_latency" | "script_custom_event" | "spawn_particle_effect" | "available_entity_identifiers" | "level_sound_event_v2" | "network_chunk_publisher_update" | "biome_definition_list" | "level_sound_event" | "level_event_generic" | "lectern_update" | "video_stream_connect" | "add_ecs_entity" | "remove_ecs_entity" | "client_cache_status" | "on_screen_texture_animation" | "map_create_locked_copy" | "structure_template_data_export_request" | "structure_template_data_export_response" | "update_block_properties" | "client_cache_blob_status" | "client_cache_miss_response" | "education_settings" | "emote" | "multiplayer_settings" | "settings_command" | "anvil_damage" | "completed_using_item" | "network_settings" | "player_auth_input" | "creative_content" | "player_enchant_options" | "item_stack_request" | "item_stack_response" | "player_armor_damage" | "update_player_game_type" | "emote_list" | "position_tracking_db_request" | "position_tracking_db_broadcast" | "violation_warning" | "motion_prediction_hints" | "animate_entity" | "camera_shake" | "player_fog" | "correct_player_move_prediction" | "item_component" | "filter_text_packet" | "debug_renderer" | "sync_entity_property" | "add_volume_entity" | "remove_volume_entity" | "simulation_type" | "npc_dialogue" | "edu_uri_resource_packet" | "create_photo" | "update_subchunk_blocks" | "photo_info_request" | "SubChunkEntryWithoutCaching" | "SubChunkEntryWithCaching" | "subchunk" | "subchunk_request" | "client_start_item_cooldown" | "script_message" | "code_builder_source" | "ticking_areas_load_status" | "dimension_data" | "agent_action" | "change_mob_property" | "lesson_progress" | "request_ability" | "request_permissions" | "toast_request" | "update_abilities" | "update_adventure_settings" | "death_info" | "editor_network" | "feature_registry" | "server_stats" | "request_network_settings" | "game_test_request" | "game_test_results" | "update_client_input_locks" | "client_cheat_ability" | "camera_presets" | "unlocked_recipes" | "camera_instruction" | "compressed_biome_definitions" | "trim_data" | "open_sign" | "agent_animation" | "refresh_entitlements"; export class Client extends Connection { constructor(options: Options) // The client's EntityID returned by the server @@ -116,8 +117,11 @@ declare module 'bedrock-protocol' { * Send a disconnect packet and close the connection */ disconnect(): void + + on(event: Packets, cb: (client: Player) => void): any } + /** * `Player` represents a player connected to the server. */ From 3a54f395a6283d36cef6745d1a1189520f20ac69 Mon Sep 17 00:00:00 2001 From: TM-Grant3 <136981990+TM-Grant3@users.noreply.github.com> Date: Wed, 11 Oct 2023 12:48:53 -0400 Subject: [PATCH 2/2] Update index.d.ts --- index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index 1c1f17a6..308bde80 100644 --- a/index.d.ts +++ b/index.d.ts @@ -102,7 +102,7 @@ declare module 'bedrock-protocol' { // # Displays "Wow this server is popular! Check back later to see if space opens up. Server Full" | 'failed_server_full' - export type Packets = "login" | "play_status" | "server_to_client_handshake" | "client_to_server_handshake" | "disconnect" | "resource_packs_info" | "resource_pack_stack" | "resource_pack_client_response" | "text" | "set_time" | "start_game" | "add_player" | "add_entity" | "remove_entity" | "add_item_entity" | "take_item_entity" | "move_entity" | "move_player" | "rider_jump" | "update_block" | "add_painting" | "tick_sync" | "level_sound_event_old" | "level_event" | "block_event" | "entity_event" | "mob_effect" | "update_attributes" | "inventory_transaction" | "mob_equipment" | "mob_armor_equipment" | "interact" | "block_pick_request" | "entity_pick_request" | "player_action" | "hurt_armor" | "set_entity_data" | "set_entity_motion" | "set_entity_link" | "set_health" | "set_spawn_position" | "animate" | "respawn" | "container_open" | "container_close" | "player_hotbar" | "inventory_content" | "inventory_slot" | "container_set_data" | "crafting_data" | "crafting_event" | "gui_data_pick_item" | "adventure_settings" | "block_entity_data" | "player_input" | "level_chunk" | "set_commands_enabled" | "set_difficulty" | "change_dimension" | "set_player_game_type" | "player_list" | "simple_event" | "event" | "spawn_experience_orb" | "clientbound_map_item_data" | "map_info_request" | "request_chunk_radius" | "chunk_radius_update" | "item_frame_drop_item" | "game_rules_changed" | "camera" | "boss_event" | "show_credits" | "available_commands" | "command_request" | "command_block_update" | "command_output" | "update_trade" | "update_equipment" | "resource_pack_data_info" | "resource_pack_chunk_data" | "resource_pack_chunk_request" | "transfer" | "play_sound" | "stop_sound" | "set_title" | "add_behavior_tree" | "structure_block_update" | "show_store_offer" | "purchase_receipt" | "player_skin" | "sub_client_login" | "initiate_web_socket_connection" | "set_last_hurt_by" | "book_edit" | "npc_request" | "photo_transfer" | "modal_form_request" | "modal_form_response" | "server_settings_request" | "server_settings_response" | "show_profile" | "set_default_game_type" | "remove_objective" | "set_display_objective" | "set_score" | "lab_table" | "update_block_synced" | "move_entity_delta" | "set_scoreboard_identity" | "set_local_player_as_initialized" | "update_soft_enum" | "network_stack_latency" | "script_custom_event" | "spawn_particle_effect" | "available_entity_identifiers" | "level_sound_event_v2" | "network_chunk_publisher_update" | "biome_definition_list" | "level_sound_event" | "level_event_generic" | "lectern_update" | "video_stream_connect" | "add_ecs_entity" | "remove_ecs_entity" | "client_cache_status" | "on_screen_texture_animation" | "map_create_locked_copy" | "structure_template_data_export_request" | "structure_template_data_export_response" | "update_block_properties" | "client_cache_blob_status" | "client_cache_miss_response" | "education_settings" | "emote" | "multiplayer_settings" | "settings_command" | "anvil_damage" | "completed_using_item" | "network_settings" | "player_auth_input" | "creative_content" | "player_enchant_options" | "item_stack_request" | "item_stack_response" | "player_armor_damage" | "update_player_game_type" | "emote_list" | "position_tracking_db_request" | "position_tracking_db_broadcast" | "violation_warning" | "motion_prediction_hints" | "animate_entity" | "camera_shake" | "player_fog" | "correct_player_move_prediction" | "item_component" | "filter_text_packet" | "debug_renderer" | "sync_entity_property" | "add_volume_entity" | "remove_volume_entity" | "simulation_type" | "npc_dialogue" | "edu_uri_resource_packet" | "create_photo" | "update_subchunk_blocks" | "photo_info_request" | "SubChunkEntryWithoutCaching" | "SubChunkEntryWithCaching" | "subchunk" | "subchunk_request" | "client_start_item_cooldown" | "script_message" | "code_builder_source" | "ticking_areas_load_status" | "dimension_data" | "agent_action" | "change_mob_property" | "lesson_progress" | "request_ability" | "request_permissions" | "toast_request" | "update_abilities" | "update_adventure_settings" | "death_info" | "editor_network" | "feature_registry" | "server_stats" | "request_network_settings" | "game_test_request" | "game_test_results" | "update_client_input_locks" | "client_cheat_ability" | "camera_presets" | "unlocked_recipes" | "camera_instruction" | "compressed_biome_definitions" | "trim_data" | "open_sign" | "agent_animation" | "refresh_entitlements"; + type Packets = "login" | "play_status" | "server_to_client_handshake" | "client_to_server_handshake" | "disconnect" | "resource_packs_info" | "resource_pack_stack" | "resource_pack_client_response" | "text" | "set_time" | "start_game" | "add_player" | "add_entity" | "remove_entity" | "add_item_entity" | "take_item_entity" | "move_entity" | "move_player" | "rider_jump" | "update_block" | "add_painting" | "tick_sync" | "level_sound_event_old" | "level_event" | "block_event" | "entity_event" | "mob_effect" | "update_attributes" | "inventory_transaction" | "mob_equipment" | "mob_armor_equipment" | "interact" | "block_pick_request" | "entity_pick_request" | "player_action" | "hurt_armor" | "set_entity_data" | "set_entity_motion" | "set_entity_link" | "set_health" | "set_spawn_position" | "animate" | "respawn" | "container_open" | "container_close" | "player_hotbar" | "inventory_content" | "inventory_slot" | "container_set_data" | "crafting_data" | "crafting_event" | "gui_data_pick_item" | "adventure_settings" | "block_entity_data" | "player_input" | "level_chunk" | "set_commands_enabled" | "set_difficulty" | "change_dimension" | "set_player_game_type" | "player_list" | "simple_event" | "event" | "spawn_experience_orb" | "clientbound_map_item_data" | "map_info_request" | "request_chunk_radius" | "chunk_radius_update" | "item_frame_drop_item" | "game_rules_changed" | "camera" | "boss_event" | "show_credits" | "available_commands" | "command_request" | "command_block_update" | "command_output" | "update_trade" | "update_equipment" | "resource_pack_data_info" | "resource_pack_chunk_data" | "resource_pack_chunk_request" | "transfer" | "play_sound" | "stop_sound" | "set_title" | "add_behavior_tree" | "structure_block_update" | "show_store_offer" | "purchase_receipt" | "player_skin" | "sub_client_login" | "initiate_web_socket_connection" | "set_last_hurt_by" | "book_edit" | "npc_request" | "photo_transfer" | "modal_form_request" | "modal_form_response" | "server_settings_request" | "server_settings_response" | "show_profile" | "set_default_game_type" | "remove_objective" | "set_display_objective" | "set_score" | "lab_table" | "update_block_synced" | "move_entity_delta" | "set_scoreboard_identity" | "set_local_player_as_initialized" | "update_soft_enum" | "network_stack_latency" | "script_custom_event" | "spawn_particle_effect" | "available_entity_identifiers" | "level_sound_event_v2" | "network_chunk_publisher_update" | "biome_definition_list" | "level_sound_event" | "level_event_generic" | "lectern_update" | "video_stream_connect" | "add_ecs_entity" | "remove_ecs_entity" | "client_cache_status" | "on_screen_texture_animation" | "map_create_locked_copy" | "structure_template_data_export_request" | "structure_template_data_export_response" | "update_block_properties" | "client_cache_blob_status" | "client_cache_miss_response" | "education_settings" | "emote" | "multiplayer_settings" | "settings_command" | "anvil_damage" | "completed_using_item" | "network_settings" | "player_auth_input" | "creative_content" | "player_enchant_options" | "item_stack_request" | "item_stack_response" | "player_armor_damage" | "update_player_game_type" | "emote_list" | "position_tracking_db_request" | "position_tracking_db_broadcast" | "violation_warning" | "motion_prediction_hints" | "animate_entity" | "camera_shake" | "player_fog" | "correct_player_move_prediction" | "item_component" | "filter_text_packet" | "debug_renderer" | "sync_entity_property" | "add_volume_entity" | "remove_volume_entity" | "simulation_type" | "npc_dialogue" | "edu_uri_resource_packet" | "create_photo" | "update_subchunk_blocks" | "photo_info_request" | "SubChunkEntryWithoutCaching" | "SubChunkEntryWithCaching" | "subchunk" | "subchunk_request" | "client_start_item_cooldown" | "script_message" | "code_builder_source" | "ticking_areas_load_status" | "dimension_data" | "agent_action" | "change_mob_property" | "lesson_progress" | "request_ability" | "request_permissions" | "toast_request" | "update_abilities" | "update_adventure_settings" | "death_info" | "editor_network" | "feature_registry" | "server_stats" | "request_network_settings" | "game_test_request" | "game_test_results" | "update_client_input_locks" | "client_cheat_ability" | "camera_presets" | "unlocked_recipes" | "camera_instruction" | "compressed_biome_definitions" | "trim_data" | "open_sign" | "agent_animation" | "refresh_entitlements"; export class Client extends Connection { constructor(options: Options) // The client's EntityID returned by the server