@hylithiumjs.com/core 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/types.d.ts CHANGED
@@ -165,7 +165,6 @@ export interface PreparedStatementBuilder {
165
165
  /**
166
166
  * Sets a null parameter.
167
167
  * @param index Parameter index (1-based)
168
- * @param value Boolean value
169
168
  */
170
169
  setNull(index: number): PreparedStatementBuilder;
171
170
  /**
@@ -349,8 +348,8 @@ export interface PlayerInteractEvent {
349
348
  getActionType(): InteractionType;
350
349
  getItemInHand(): ItemStack;
351
350
  getTargetBlock(): Vector3i;
352
- getTargetRef(): Ref<EntityStore>;
353
- getPlayerRef(): Ref<EntityStore>;
351
+ getTargetRef(): Ref;
352
+ getPlayerRef(): Ref;
354
353
  getPlayer(): Player;
355
354
  }
356
355
  export interface PlayerCraftEvent {
@@ -459,6 +458,20 @@ export interface LivingEntityUseBlockEvent {
459
458
  getBlockType(): string;
460
459
  }
461
460
  export interface BreakBlockEvent {
461
+ getPlayer(): Player | null;
462
+ getEvent(): BreakBlockEventData;
463
+ getItemInHand(): ItemStack;
464
+ getTargetBlock(): Vector3i;
465
+ getBlockType(): BlockType;
466
+ setTargetBlock(arg0: Vector3i): void;
467
+ isCancelled(): boolean;
468
+ setCancelled(arg0: boolean): void;
469
+ }
470
+ /**
471
+ * The inner event data for BreakBlockEvent.
472
+ * Access via event.getEvent() when you need the raw event.
473
+ */
474
+ export interface BreakBlockEventData {
462
475
  getItemInHand(): ItemStack;
463
476
  getTargetBlock(): Vector3i;
464
477
  getBlockType(): BlockType;
@@ -467,6 +480,21 @@ export interface BreakBlockEvent {
467
480
  setCancelled(arg0: boolean): void;
468
481
  }
469
482
  export interface PlaceBlockEvent {
483
+ getPlayer(): Player | null;
484
+ getEvent(): PlaceBlockEventData;
485
+ getRotation(): RotationTuple;
486
+ setRotation(arg0: RotationTuple): void;
487
+ getItemInHand(): ItemStack;
488
+ getTargetBlock(): Vector3i;
489
+ setTargetBlock(arg0: Vector3i): void;
490
+ isCancelled(): boolean;
491
+ setCancelled(arg0: boolean): void;
492
+ }
493
+ /**
494
+ * The inner event data for PlaceBlockEvent.
495
+ * Access via event.getEvent() when you need the raw event.
496
+ */
497
+ export interface PlaceBlockEventData {
470
498
  getRotation(): RotationTuple;
471
499
  setRotation(arg0: RotationTuple): void;
472
500
  getItemInHand(): ItemStack;
@@ -766,15 +794,12 @@ export interface World {
766
794
  getPlayers(): Player[];
767
795
  getPlayerCount(): number;
768
796
  getPlayerRefs(): PlayerRef[];
769
- getTps(): number;
770
797
  sendMessage(arg0: Message): void;
771
798
  getBlockType(arg0: Vector3i): BlockType;
772
799
  getBlockType(arg0: number, arg1: number, arg2: number): BlockType;
773
800
  setBlock(arg0: number, arg1: number, arg2: number, arg3: string, arg4: number): void;
774
801
  setBlock(arg0: number, arg1: number, arg2: number, arg3: string): void;
775
802
  breakBlock(arg0: number, arg1: number, arg2: number, arg3: number): boolean;
776
- getEntityStore(): EntityStoreWrapper;
777
- execute(task: () => void): void;
778
803
  }
779
804
  export interface Universe {
780
805
  get(): Universe;
@@ -879,15 +904,11 @@ export interface BlockState {
879
904
  getBlockY(): number;
880
905
  getBlockZ(): number;
881
906
  }
882
- export interface Holder<T = unknown> {
883
- getComponent<C>(arg0: ComponentType<T, C>): C | null;
884
- addComponent<C>(componentType: ComponentType<T, C>, component: C): void;
885
- ensureComponent<C>(componentType: ComponentType<T, C>): void;
907
+ export interface Holder {
908
+ getComponent(arg0: ComponentType): unknown;
886
909
  }
887
- export interface Ref<T = unknown> {
910
+ export interface Ref {
888
911
  isValid(): boolean;
889
- getStore(): Store<T>;
890
- getIndex(): number;
891
912
  }
892
913
  export interface Vector3i {
893
914
  new (): Vector3i;
@@ -1030,10 +1051,9 @@ export interface ItemStackTransaction {
1030
1051
  }
1031
1052
  export interface ItemStackSlotTransaction {
1032
1053
  }
1033
- export interface ComponentType<S = unknown, C = unknown> {
1054
+ export interface ComponentType {
1034
1055
  }
1035
- export interface ComponentAccessor<S = unknown> {
1036
- getComponent<C>(ref: Ref<S>, componentType: ComponentType<S, C>): C | null;
1056
+ export interface ComponentAccessor {
1037
1057
  }
1038
1058
  export interface DisconnectReason {
1039
1059
  }
@@ -1072,7 +1092,7 @@ export interface DefaultAssetMap {
1072
1092
  export interface AssetStore {
1073
1093
  getAssetMap(): DefaultAssetMap;
1074
1094
  }
1075
- export type EventType = "BootEvent" | "ShutdownEvent" | "PrepareUniverseEvent" | "PlayerConnectEvent" | "PlayerDisconnectEvent" | "PlayerChatEvent" | "PlayerReadyEvent" | "PlayerInteractEvent" | "PlayerCraftEvent" | "PlayerMouseButtonEvent" | "PlayerMouseMotionEvent" | "PlayerSetupConnectEvent" | "PlayerSetupDisconnectEvent" | "AddPlayerToWorldEvent" | "DrainPlayerFromWorldEvent" | "PlayerRefEvent" | "PlayerEvent" | "EntityEvent" | "EntityRemoveEvent" | "LivingEntityInventoryChangeEvent" | "LivingEntityUseBlockEvent" | "BreakBlockEvent" | "PlaceBlockEvent" | "DamageBlockEvent" | "UseBlockEvent" | "DropItemEvent" | "InteractivelyPickupItemEvent" | "ChangeGameModeEvent" | "CraftRecipeEvent" | "DiscoverZoneEvent" | "SwitchActiveSlotEvent" | "PlayerPermissionChangeEvent" | "GroupPermissionChangeEvent" | "PlayerGroupEvent" | "NPCSpawnEvent" | "NPCDespawnEvent" | "NPCRoleChangeEvent" | "NPCDamageEvent" | "NPCDeathEvent";
1095
+ export type EventType = "BootEvent" | "ShutdownEvent" | "PrepareUniverseEvent" | "PlayerConnectEvent" | "PlayerDisconnectEvent" | "PlayerChatEvent" | "PlayerReadyEvent" | "PlayerInteractEvent" | "PlayerCraftEvent" | "PlayerMouseButtonEvent" | "PlayerMouseMotionEvent" | "PlayerSetupConnectEvent" | "PlayerSetupDisconnectEvent" | "AddPlayerToWorldEvent" | "DrainPlayerFromWorldEvent" | "PlayerRefEvent" | "PlayerEvent" | "EntityEvent" | "EntityRemoveEvent" | "LivingEntityInventoryChangeEvent" | "LivingEntityUseBlockEvent" | "BreakBlockEvent" | "PlaceBlockEvent" | "DamageBlockEvent" | "UseBlockEvent" | "DropItemEvent" | "InteractivelyPickupItemEvent" | "ChangeGameModeEvent" | "CraftRecipeEvent" | "DiscoverZoneEvent" | "SwitchActiveSlotEvent" | "PlayerPermissionChangeEvent" | "GroupPermissionChangeEvent" | "PlayerGroupEvent";
1076
1096
  export type HexColor = `#${string}`;
1077
1097
  export declare const Colors: {
1078
1098
  readonly RED: HexColor;
@@ -1117,20 +1137,10 @@ export interface ScriptLogger {
1117
1137
  severe(message: string): void;
1118
1138
  fine(message: string): void;
1119
1139
  }
1120
- export interface CommandSender {
1121
- getDisplayName(): string;
1122
- getUuid(): unknown;
1123
- sendMessage(message: Message): void;
1124
- }
1125
1140
  export interface CommandContext {
1126
1141
  sendMessage(message: string): void;
1127
- sendFormattedMessage(message: Message): void;
1128
1142
  getSenderName(): string;
1129
1143
  getInput(): string;
1130
- isPlayer(): boolean;
1131
- getSender(): CommandSender;
1132
- getPlayer(): Player | null;
1133
- getPlayerRef(): Ref<EntityStore> | null;
1134
1144
  }
1135
1145
  export interface ScriptCommandRegistry {
1136
1146
  register(name: string, description: string, callback: (ctx: CommandContext) => void): void;
@@ -1313,14 +1323,13 @@ export interface PlayerRef {
1313
1323
  getTransform(): Transform;
1314
1324
  getWorldUuid(): {
1315
1325
  toString(): string;
1316
- } | null;
1326
+ };
1317
1327
  getHeadRotation(): Vector3f;
1318
1328
  updatePosition(world: World, transform: Transform, headRotation: Vector3f): void;
1319
1329
  getPacketHandler(): PacketHandler;
1320
1330
  referToServer(host: string, port: number): void;
1321
1331
  referToServer(host: string, port: number, data: unknown[]): void;
1322
1332
  sendMessage(message: Message): void;
1323
- getReference(): Ref<EntityStore> | null;
1324
1333
  }
1325
1334
  export interface DynamicLight {
1326
1335
  new (): DynamicLight;
@@ -1440,8 +1449,7 @@ export interface DisplayNameComponent {
1440
1449
  }
1441
1450
  export interface TransformComponent {
1442
1451
  new (): TransformComponent;
1443
- new (position: Vector3d, rotation: Vector3f): TransformComponent;
1444
- getComponentType(): ComponentType<EntityStore, TransformComponent>;
1452
+ getComponentType(): ComponentType;
1445
1453
  getPosition(): Vector3d;
1446
1454
  setPosition(position: Vector3d): void;
1447
1455
  teleportPosition(position: Vector3d): void;
@@ -5110,735 +5118,55 @@ export interface JavetCallMetrics {
5110
5118
  getAvgTimeMs(): number;
5111
5119
  nanoTime(): number;
5112
5120
  }
5113
- export interface EntityStore {
5114
- getWorld(): World;
5115
- getStore(): Store<EntityStore>;
5116
- getRefFromUUID(uuid: {
5117
- toString(): string;
5118
- }): Ref<EntityStore> | null;
5119
- getRefFromNetworkId(networkId: number): Ref<EntityStore> | null;
5120
- }
5121
- export interface Store<T> {
5122
- getExternalData(): T;
5123
- getEntityCount(): number;
5124
- getComponent<C>(ref: Ref<T>, componentType: ComponentType<T, C>): C | null;
5125
- ensureAndGetComponent<C>(ref: Ref<T>, componentType: ComponentType<T, C>): C;
5126
- addComponent<C>(ref: Ref<T>, componentType: ComponentType<T, C>): C;
5127
- addComponent<C>(ref: Ref<T>, componentType: ComponentType<T, C>, component: C): void;
5128
- putComponent<C>(ref: Ref<T>, componentType: ComponentType<T, C>, component: C): void;
5129
- removeComponent<C>(ref: Ref<T>, componentType: ComponentType<T, C>): void;
5130
- getArchetype(ref: Ref<T>): unknown;
5131
- addEntity(holder: Holder<T>, addReason: AddReason): Ref<T> | null;
5132
- removeEntity(ref: Ref<T>, removeReason: RemoveReason): void;
5133
- forEachChunk<C>(componentType: ComponentType<T, C>, callback: (archetypeChunk: ArchetypeChunk<T>, commandBuffer: CommandBuffer<T>) => void): void;
5134
- forEachEntityParallel<C>(componentType: ComponentType<T, C>, callback: (index: number, archetypeChunk: ArchetypeChunk<T>, commandBuffer: CommandBuffer<T>) => void): void;
5135
- getResource<R>(resourceType: ResourceType<T, R>): R;
5136
- }
5137
- export interface EntityStoreWrapper {
5138
- getStore(): Store<EntityStore>;
5139
- }
5140
- export interface ArchetypeChunk<T> {
5141
- size(): number;
5142
- getComponent<C>(index: number, componentType: ComponentType<T, C>): C | null;
5143
- getReferenceTo(index: number): Ref<T>;
5144
- }
5145
- export interface CommandBuffer<T> {
5146
- getComponent<C>(ref: Ref<T>, componentType: ComponentType<T, C>): C | null;
5147
- putComponent<C>(ref: Ref<T>, componentType: ComponentType<T, C>, component: C): void;
5148
- removeComponent<C>(ref: Ref<T>, componentType: ComponentType<T, C>): void;
5149
- addComponent<C>(ref: Ref<T>, componentType: ComponentType<T, C>, component: C): void;
5150
- }
5151
- export interface AddReason {
5152
- name(): string;
5153
- }
5154
- export interface AddReasonEnum {
5155
- SPAWN: AddReason;
5156
- LOAD: AddReason;
5157
- EXTERNAL: AddReason;
5158
- WORLDGEN: AddReason;
5159
- }
5160
- export interface RemoveReason {
5161
- name(): string;
5162
- }
5163
- export interface RemoveReasonEnum {
5164
- DESPAWN: RemoveReason;
5165
- UNLOAD: RemoveReason;
5166
- EXTERNAL: RemoveReason;
5167
- }
5168
- export interface Area {
5169
- x: number;
5170
- y: number;
5171
- width: number;
5172
- height: number;
5173
- }
5174
- export interface Anchor {
5175
- width: number | null;
5176
- height: number | null;
5177
- top: number | null;
5178
- bottom: number | null;
5179
- left: number | null;
5180
- right: number | null;
5181
- full: number | null;
5182
- horizontal: number | null;
5183
- vertical: number | null;
5184
- }
5185
- export interface LocalizableString {
5186
- key: string;
5187
- params: JavaMap<string, string> | null;
5188
- }
5189
- export interface PatchStyle {
5190
- texturePath: string;
5191
- border: number | null;
5192
- horizontalBorder: number | null;
5193
- verticalBorder: number | null;
5194
- }
5195
- export interface ItemGridSlot {
5196
- slotIndex: number;
5197
- itemStack: ItemStack | null;
5198
- }
5199
- export interface DropdownEntryInfo {
5200
- label: string;
5201
- value: string;
5202
- }
5203
- export interface CustomUIEventBindingType {
5204
- getValue(): number;
5205
- name(): string;
5206
- }
5207
- export interface CustomUIEventBindingTypeEnum {
5208
- Activating: CustomUIEventBindingType;
5209
- RightClicking: CustomUIEventBindingType;
5210
- DoubleClicking: CustomUIEventBindingType;
5211
- MouseEntered: CustomUIEventBindingType;
5212
- MouseExited: CustomUIEventBindingType;
5213
- ValueChanged: CustomUIEventBindingType;
5214
- ElementReordered: CustomUIEventBindingType;
5215
- Validating: CustomUIEventBindingType;
5216
- Dismissing: CustomUIEventBindingType;
5217
- FocusGained: CustomUIEventBindingType;
5218
- FocusLost: CustomUIEventBindingType;
5219
- KeyDown: CustomUIEventBindingType;
5220
- MouseButtonReleased: CustomUIEventBindingType;
5221
- SlotClicking: CustomUIEventBindingType;
5222
- SlotDoubleClicking: CustomUIEventBindingType;
5223
- SlotMouseEntered: CustomUIEventBindingType;
5224
- SlotMouseExited: CustomUIEventBindingType;
5225
- DragCancelled: CustomUIEventBindingType;
5226
- Dropped: CustomUIEventBindingType;
5227
- SlotMouseDragCompleted: CustomUIEventBindingType;
5228
- SlotMouseDragExited: CustomUIEventBindingType;
5229
- SlotClickReleaseWhileDragging: CustomUIEventBindingType;
5230
- SlotClickPressWhileDragging: CustomUIEventBindingType;
5231
- SelectedTabChanged: CustomUIEventBindingType;
5232
- VALUES: CustomUIEventBindingType[];
5233
- fromValue(value: number): CustomUIEventBindingType;
5234
- }
5235
- export interface CustomPageLifetime {
5236
- getValue(): number;
5237
- name(): string;
5238
- }
5239
- export interface CustomPageLifetimeEnum {
5240
- CantClose: CustomPageLifetime;
5241
- CanDismiss: CustomPageLifetime;
5242
- CanDismissOrCloseThroughInteraction: CustomPageLifetime;
5243
- VALUES: CustomPageLifetime[];
5244
- fromValue(value: number): CustomPageLifetime;
5245
- }
5246
- export interface CustomUICommandType {
5247
- getValue(): number;
5248
- name(): string;
5249
- }
5250
- export interface CustomUICommandTypeEnum {
5251
- Clear: CustomUICommandType;
5252
- Remove: CustomUICommandType;
5253
- Append: CustomUICommandType;
5254
- AppendInline: CustomUICommandType;
5255
- InsertBefore: CustomUICommandType;
5256
- InsertBeforeInline: CustomUICommandType;
5257
- Set: CustomUICommandType;
5258
- VALUES: CustomUICommandType[];
5259
- fromValue(value: number): CustomUICommandType;
5260
- }
5261
- export interface HudComponent {
5262
- getValue(): number;
5263
- name(): string;
5264
- }
5265
- export interface HudComponentEnum {
5266
- Hotbar: HudComponent;
5267
- StatusIcons: HudComponent;
5268
- Reticle: HudComponent;
5269
- Chat: HudComponent;
5270
- Requests: HudComponent;
5271
- Notifications: HudComponent;
5272
- KillFeed: HudComponent;
5273
- InputBindings: HudComponent;
5274
- PlayerList: HudComponent;
5275
- EventTitle: HudComponent;
5276
- Compass: HudComponent;
5277
- ObjectivePanel: HudComponent;
5278
- PortalPanel: HudComponent;
5279
- BuilderToolsLegend: HudComponent;
5280
- Speedometer: HudComponent;
5281
- UtilitySlotSelector: HudComponent;
5282
- BlockVariantSelector: HudComponent;
5283
- BuilderToolsMaterialSlotSelector: HudComponent;
5284
- Stamina: HudComponent;
5285
- AmmoIndicator: HudComponent;
5286
- Health: HudComponent;
5287
- Mana: HudComponent;
5288
- Oxygen: HudComponent;
5289
- Sleep: HudComponent;
5290
- VALUES: HudComponent[];
5291
- fromValue(value: number): HudComponent;
5292
- }
5293
- export interface Page {
5294
- getValue(): number;
5295
- name(): string;
5296
- }
5297
- export interface PageEnum {
5298
- None: Page;
5299
- Inventory: Page;
5300
- Crafting: Page;
5301
- Map: Page;
5302
- Container: Page;
5303
- Respawn: Page;
5304
- Shop: Page;
5305
- VALUES: Page[];
5306
- fromValue(value: number): Page;
5307
- }
5308
- export interface Value<T> {
5309
- getValue(): T | null;
5310
- getDocumentPath(): string | null;
5311
- getValueName(): string | null;
5312
- }
5313
- export interface ValueStatic {
5314
- ref<T>(document: string, value: string): Value<T>;
5315
- of<T>(value: T): Value<T>;
5316
- }
5317
- export interface EventData {
5318
- events(): JavaMap<string, string>;
5319
- append(key: string, value: string): EventData;
5320
- append<T extends string>(key: string, enumValue: {
5321
- name(): T;
5322
- }): EventData;
5323
- put(key: string, value: string): EventData;
5324
- }
5325
- export interface EventDataStatic {
5326
- new (): EventData;
5327
- of(key: string, value: string): EventData;
5328
- }
5329
- export interface UICommandBuilder {
5330
- clear(selector: string): UICommandBuilder;
5331
- remove(selector: string): UICommandBuilder;
5332
- append(documentPath: string): UICommandBuilder;
5333
- append(selector: string, documentPath: string): UICommandBuilder;
5334
- appendInline(selector: string, document: string): UICommandBuilder;
5335
- insertBefore(selector: string, documentPath: string): UICommandBuilder;
5336
- insertBeforeInline(selector: string, document: string): UICommandBuilder;
5337
- set<T>(selector: string, ref: Value<T>): UICommandBuilder;
5338
- set(selector: string, value: string): UICommandBuilder;
5339
- set(selector: string, value: Message): UICommandBuilder;
5340
- set(selector: string, value: boolean): UICommandBuilder;
5341
- set(selector: string, value: number): UICommandBuilder;
5342
- setNull(selector: string): UICommandBuilder;
5343
- setObject(selector: string, data: Area | ItemGridSlot | ItemStack | LocalizableString | PatchStyle | DropdownEntryInfo | Anchor): UICommandBuilder;
5344
- set<T>(selector: string, data: T[]): UICommandBuilder;
5345
- set<T>(selector: string, data: JavaList<T>): UICommandBuilder;
5346
- getCommands(): CustomUICommand[];
5347
- }
5348
- export interface UICommandBuilderStatic {
5349
- new (): UICommandBuilder;
5350
- EMPTY_COMMAND_ARRAY: CustomUICommand[];
5351
- }
5352
- export interface UIEventBuilder {
5353
- addEventBinding(type: CustomUIEventBindingType, selector: string): UIEventBuilder;
5354
- addEventBinding(type: CustomUIEventBindingType, selector: string, locksInterface: boolean): UIEventBuilder;
5355
- addEventBinding(type: CustomUIEventBindingType, selector: string, data: EventData): UIEventBuilder;
5356
- addEventBinding(type: CustomUIEventBindingType, selector: string, data: EventData | null, locksInterface: boolean): UIEventBuilder;
5357
- getEvents(): CustomUIEventBinding[];
5358
- }
5359
- export interface UIEventBuilderStatic {
5360
- new (): UIEventBuilder;
5361
- EMPTY_EVENT_BINDING_ARRAY: CustomUIEventBinding[];
5362
- }
5363
- export interface CustomUICommand {
5364
- type: CustomUICommandType;
5365
- selector: string | null;
5366
- value: string | null;
5367
- documentPath: string | null;
5368
- }
5369
- export interface CustomUIEventBinding {
5370
- type: CustomUIEventBindingType;
5371
- selector: string | null;
5372
- data: string | null;
5373
- locksInterface: boolean;
5374
- }
5375
- export interface CustomPage {
5376
- name: string;
5377
- open: boolean;
5378
- clear: boolean;
5379
- lifetime: CustomPageLifetime;
5380
- commands: CustomUICommand[];
5381
- events: CustomUIEventBinding[];
5382
- }
5383
- export interface CustomHud {
5384
- clear: boolean;
5385
- commands: CustomUICommand[] | null;
5386
- }
5387
- export interface CustomUIPage {
5388
- getLifetime(): CustomPageLifetime;
5389
- setLifetime(lifetime: CustomPageLifetime): void;
5390
- build(ref: Ref<EntityStore>, commandBuilder: UICommandBuilder, eventBuilder: UIEventBuilder, store: Store<EntityStore>): void;
5391
- handleDataEvent(ref: Ref<EntityStore>, store: Store<EntityStore>, rawData: string): void;
5392
- onDismiss(ref: Ref<EntityStore>, store: Store<EntityStore>): void;
5393
- }
5394
- export interface CustomUIHud {
5395
- build(commandBuilder: UICommandBuilder): void;
5396
- show(): void;
5397
- update(clear: boolean, commandBuilder: UICommandBuilder): void;
5398
- getPlayerRef(): PlayerRef;
5399
- }
5400
- export interface PageManager {
5401
- getCustomPage(): CustomUIPage | null;
5402
- setPage(ref: Ref<EntityStore>, store: Store<EntityStore>, page: Page): void;
5403
- setPage(ref: Ref<EntityStore>, store: Store<EntityStore>, page: Page, canCloseThroughInteraction: boolean): void;
5404
- openCustomPage(ref: Ref<EntityStore>, store: Store<EntityStore>, page: CustomUIPage): void;
5405
- updateCustomPage(page: CustomPage): void;
5406
- }
5407
- export interface HudManager {
5408
- getCustomHud(): CustomUIHud | null;
5409
- getVisibleHudComponents(): JavaSet<HudComponent>;
5410
- setVisibleHudComponents(ref: PlayerRef, ...hudComponents: HudComponent[]): void;
5411
- showHudComponents(ref: PlayerRef, ...hudComponents: HudComponent[]): void;
5412
- hideHudComponents(ref: PlayerRef, ...hudComponents: HudComponent[]): void;
5413
- setCustomHud(ref: PlayerRef, hud: CustomUIHud | null): void;
5414
- resetHud(ref: PlayerRef): void;
5415
- resetUserInterface(ref: PlayerRef): void;
5416
- }
5417
- export type ScriptCustomUIPageBuildCallback = (ref: Ref<EntityStore>, commandBuilder: UICommandBuilder, eventBuilder: UIEventBuilder, store: Store<EntityStore>) => void;
5418
- export type ScriptCustomUIPageEventCallback = (ref: Ref<EntityStore>, store: Store<EntityStore>, rawData: string) => void;
5419
- export type ScriptCustomUIPageDismissCallback = (ref: Ref<EntityStore>, store: Store<EntityStore>) => void;
5420
- export interface ScriptCustomUIPage extends CustomUIPage {
5421
- triggerRebuild(): void;
5422
- triggerSendUpdate(): void;
5423
- triggerSendUpdate(commandBuilder: UICommandBuilder): void;
5424
- triggerSendUpdate(commandBuilder: UICommandBuilder, clear: boolean): void;
5425
- triggerClose(): void;
5426
- getPlayerRef(): PlayerRef;
5427
- getPageLifetime(): CustomPageLifetime;
5428
- setPageLifetime(lifetime: CustomPageLifetime): void;
5429
- }
5430
- export interface ScriptCustomUIPageStatic {
5431
- new (playerRef: PlayerRef, lifetime: CustomPageLifetime, buildCallback: ScriptCustomUIPageBuildCallback): ScriptCustomUIPage;
5432
- new (playerRef: PlayerRef, lifetime: CustomPageLifetime, buildCallback: ScriptCustomUIPageBuildCallback, eventCallback: ScriptCustomUIPageEventCallback | null): ScriptCustomUIPage;
5433
- new (playerRef: PlayerRef, lifetime: CustomPageLifetime, buildCallback: ScriptCustomUIPageBuildCallback, eventCallback: ScriptCustomUIPageEventCallback | null, dismissCallback: ScriptCustomUIPageDismissCallback | null): ScriptCustomUIPage;
5434
- }
5435
- export type ScriptCustomUIHudBuildCallback = (commandBuilder: UICommandBuilder) => void;
5436
- export interface ScriptCustomUIHud extends CustomUIHud {
5437
- triggerShow(): void;
5438
- triggerUpdate(commandBuilder: UICommandBuilder): void;
5439
- triggerUpdate(commandBuilder: UICommandBuilder, clear: boolean): void;
5440
- getPlayerRef(): PlayerRef;
5441
- }
5442
- export interface ScriptCustomUIHudStatic {
5443
- new (playerRef: PlayerRef, buildCallback: ScriptCustomUIHudBuildCallback): ScriptCustomUIHud;
5444
- }
5445
- export type JavaByteArray = unknown;
5446
- export type JavaCompletableFuture<T> = unknown;
5447
- export interface CommonAsset {
5448
- getName(): string;
5449
- getHash(): string;
5450
- getBlob(): JavaCompletableFuture<JavaByteArray>;
5451
- }
5452
- export interface ByteArrayCommonAsset extends CommonAsset {
5453
- }
5454
- export interface ByteArrayCommonAssetStatic {
5455
- new (name: string, bytes: JavaByteArray): ByteArrayCommonAsset;
5456
- new (name: string, content: string): ByteArrayCommonAsset;
5457
- }
5458
- export interface CommonAssetModule {
5459
- addCommonAsset<T extends CommonAsset>(pack: string, asset: T): void;
5460
- addCommonAsset<T extends CommonAsset>(pack: string, asset: T, log: boolean): void;
5461
- }
5462
- export interface CommonAssetModuleStatic {
5463
- get(): CommonAssetModule;
5464
- }
5465
- export interface NPCEntity extends LivingEntity {
5466
- getRole(): Role | null;
5467
- getRoleIndex(): number;
5468
- getRoleName(): string | null;
5469
- setRoleName(roleName: string): void;
5470
- setRoleIndex(roleIndex: number): void;
5471
- getLeashPoint(): Vector3d;
5472
- setLeashPoint(leashPoint: Vector3d): void;
5473
- getLeashHeading(): number;
5474
- getLeashPitch(): number;
5475
- saveLeashInformation(position: Vector3d, rotation: Vector3f): void;
5476
- getAlarmStore(): AlarmStore;
5477
- getDamageData(): DamageData;
5478
- clearDamageData(): void;
5479
- setToDespawn(): void;
5480
- setDespawnTime(time: number): void;
5481
- getDespawnTime(): number;
5482
- setDespawning(despawning: boolean): void;
5483
- setPlayingDespawnAnim(playingDespawnAnim: boolean): void;
5484
- setDespawnRemainingSeconds(seconds: number): void;
5485
- setDespawnCheckRemainingSeconds(seconds: number): void;
5486
- setDespawnAnimationRemainingSeconds(seconds: number): void;
5487
- setInitialModelScale(scale: number): void;
5488
- getOldPosition(): Vector3d;
5489
- playAnimation(ref: Ref<EntityStore>, animationSlot: AnimationSlot, animationId: string | null, componentAccessor: ComponentAccessor<EntityStore>): void;
5490
- onFlockSetState(ref: Ref<EntityStore>, state: string, subState: string | null, componentAccessor: ComponentAccessor<EntityStore>): void;
5491
- onFlockSetTarget(targetSlot: string, target: Ref<EntityStore>): void;
5492
- getSpawnInstant(): unknown;
5493
- setSpawnInstant(instant: unknown): void;
5494
- getEnvironmentIndex(): number;
5495
- getSpawnConfigurationIndex(): number;
5496
- isSpawnTracked(): boolean;
5497
- setSpawnTracked(tracked: boolean): void;
5498
- }
5499
- export interface NPCEntityStatic {
5500
- getComponentType(): ComponentType<EntityStore, NPCEntity> | null;
5501
- CODEC: unknown;
5502
- }
5503
- export interface LivingEntity extends Entity {
5504
- getInventory(): Inventory;
5505
- setInventory(inventory: Inventory): Inventory;
5506
- getStatMap(): EntityStatMap | null;
5507
- }
5508
- export interface Role {
5509
- getRoleIndex(): number;
5510
- getRoleName(): string;
5511
- getCombatSupport(): CombatSupport;
5512
- getStateSupport(): StateSupport;
5513
- getMarkedEntitySupport(): MarkedEntitySupport;
5514
- getWorldSupport(): WorldSupport;
5515
- getEntitySupport(): EntitySupport;
5516
- getPositionCache(): PositionCache;
5517
- getDebugSupport(): DebugSupport;
5518
- isActivated(): boolean;
5519
- isRoleChangeRequested(): boolean;
5520
- canBreathe(breathingMaterial: unknown, fluidId: number): boolean;
5521
- requiresLeashPosition(): boolean;
5522
- setMarkedTarget(targetSlot: string, target: Ref<EntityStore>): void;
5523
- getAppearance(): string;
5524
- getInitialMaxHealth(): number;
5525
- getCollisionRadius(): number;
5526
- isInvulnerable(): boolean;
5527
- getDeathAnimationTime(): number;
5528
- getDespawnAnimationTime(): number;
5529
- getDropListId(): string;
5530
- getDeathInteraction(): string | null;
5531
- getInventorySlots(): number;
5532
- getHotbarSlots(): number;
5533
- getOffHandSlots(): number;
5534
- getFlockSpawnTypes(): string[] | null;
5535
- getFlockAllowedRoles(): string[];
5536
- canLeadFlock(): boolean;
5537
- isCorpseStaysInFlock(): boolean;
5538
- getInertia(): number;
5539
- getKnockbackScale(): number;
5540
- isBreathesInAir(): boolean;
5541
- isBreathesInWater(): boolean;
5542
- isPickupDropOnDeath(): boolean;
5543
- getBalanceAsset(): string | null;
5544
- getSpawnLockTime(): number;
5545
- getNameTranslationKey(): string;
5546
- }
5547
- export interface CombatSupport {
5548
- getCanCauseDamage(attackerRef: Ref<EntityStore>, componentAccessor: ComponentAccessor<EntityStore>): boolean;
5549
- }
5550
- export interface StateSupport {
5551
- setState(ref: Ref<EntityStore>, state: string, subState: string | null, componentAccessor: ComponentAccessor<EntityStore>): void;
5552
- getState(): string | null;
5553
- getSubState(): string | null;
5554
- addInteraction(ref: Ref<EntityStore>, interactionRef: Ref<EntityStore>, componentAccessor: ComponentAccessor<EntityStore>): void;
5555
- willInteractWith(ref: Ref<EntityStore>): boolean;
5556
- }
5557
- export interface MarkedEntitySupport {
5558
- getMarkedTarget(targetSlot: string): Ref<EntityStore> | null;
5559
- setMarkedTarget(targetSlot: string, target: Ref<EntityStore>): void;
5560
- clearMarkedTarget(targetSlot: string): void;
5561
- hasMarkedTarget(targetSlot: string): boolean;
5562
- }
5563
- export interface WorldSupport {
5564
- getWorld(): World;
5565
- }
5566
- export interface EntitySupport {
5567
- getDisplayName(): string | null;
5568
- setDisplayName(ref: Ref<EntityStore>, displayName: string, componentAccessor: ComponentAccessor<EntityStore>): void;
5569
- }
5570
- export interface PositionCache {
5571
- getPosition(): Vector3d;
5572
- getRotation(): Vector3f;
5573
- }
5574
- export interface DebugSupport {
5575
- isDebugEnabled(): boolean;
5576
- setDebugEnabled(enabled: boolean): void;
5577
- }
5578
- export interface AlarmStore {
5579
- getAlarm(alarmId: string): number;
5580
- setAlarm(alarmId: string, time: number): void;
5581
- removeAlarm(alarmId: string): void;
5582
- hasAlarm(alarmId: string): boolean;
5583
- }
5584
- export interface DamageData {
5585
- reset(): void;
5586
- getLastDamageSource(): Ref<EntityStore> | null;
5587
- getLastDamageAmount(): number;
5588
- getLastDamageTime(): number;
5589
- getTotalDamageReceived(): number;
5590
- }
5591
- export interface AnimationSlot {
5592
- ordinal(): number;
5593
- name(): string;
5594
- }
5595
- export interface AnimationSlotEnum {
5596
- Action: AnimationSlot;
5597
- Base: AnimationSlot;
5598
- Emote: AnimationSlot;
5599
- values(): AnimationSlot[];
5600
- valueOf(name: string): AnimationSlot;
5601
- }
5602
- export interface NPCPlugin {
5603
- get(): NPCPlugin;
5604
- getIndex(builderName: string): number;
5605
- getName(builderIndex: number): string | null;
5606
- hasRoleName(roleName: string): boolean;
5607
- validateSpawnableRole(roleName: string): void;
5608
- getRoleTemplateNames(spawnableOnly: boolean): string[];
5609
- tryGetCachedValidRole(roleIndex: number): Builder<Role> | null;
5610
- getRoleBuilderInfo(roleIndex: number): BuilderInfo | null;
5611
- spawnNPC(store: Store<EntityStore>, npcType: string, groupType: string | null, position: Vector3d, rotation: Vector3f): JavaPair<Ref<EntityStore>, INonPlayerCharacter> | null;
5612
- spawnEntity(store: Store<EntityStore>, roleIndex: number, position: Vector3d, rotation: Vector3f | null, spawnModel: Model | null, postSpawn: TriConsumer<NPCEntity, Ref<EntityStore>, Store<EntityStore>> | null): JavaPair<Ref<EntityStore>, NPCEntity> | null;
5613
- getBlackboardResourceType(): ResourceType<EntityStore, Blackboard>;
5614
- getNpcSpatialResource(): SpatialResource<EntityStore>;
5615
- getAttitudeMap(): AttitudeMap;
5616
- getItemAttitudeMap(): ItemAttitudeMap;
5617
- getBuilderManager(): BuilderManager;
5618
- getBeaconSupportComponentType(): ComponentType<EntityStore, BeaconSupport>;
5619
- getNpcBlockEventSupportComponentType(): ComponentType<EntityStore, NPCBlockEventSupport>;
5620
- getNpcEntityEventSupportComponentType(): ComponentType<EntityStore, NPCEntityEventSupport>;
5621
- getTimersComponentType(): ComponentType<EntityStore, Timers>;
5622
- getStateEvaluatorComponentType(): ComponentType<EntityStore, StateEvaluator>;
5623
- getValueStoreComponentType(): ComponentType<EntityStore, ValueStore>;
5624
- }
5625
- export interface NPCPluginStatic {
5626
- get(): NPCPlugin;
5627
- reloadNPCsWithRole(roleIndex: number): void;
5628
- buildRole(roleBuilder: Builder<Role>, builderInfo: BuilderInfo, builderSupport: BuilderSupport, roleIndex: number): Role;
5629
- }
5630
- export interface INonPlayerCharacter {
5631
- getRole(): Role | null;
5632
- getRoleIndex(): number;
5633
- }
5634
- export interface Builder<T> {
5635
- build2(builderSupport: BuilderSupport): T;
5636
- getBuilderParameters(): unknown;
5637
- category(): unknown;
5638
- isSpawnable(): boolean;
5639
- }
5640
- export interface BuilderInfo {
5641
- getKeyName(): string;
5642
- getBuilder(): Builder<unknown>;
5643
- isValid(): boolean;
5644
- isValidated(): boolean;
5645
- setNeedsReload(): void;
5646
- }
5647
- export interface BuilderSupport {
5648
- setScope(scope: unknown): void;
5649
- setGlobalScope(scope: unknown): void;
5650
- }
5651
- export interface BuilderManager {
5652
- getIndex(builderName: string): number;
5653
- lookupName(builderIndex: number): string | null;
5654
- tryGetCachedValidRole(roleIndex: number): Builder<Role> | null;
5655
- tryGetBuilderInfo(builderIndex: number): BuilderInfo | null;
5656
- getCachedBuilderInfo(roleIndex: number, category: unknown): BuilderInfo;
5657
- validateBuilder(builderInfo: BuilderInfo): boolean;
5658
- forceValidation(builderIndex: number): void;
5659
- }
5660
- export interface Blackboard {
5661
- getValue(key: string): unknown;
5662
- setValue(key: string, value: unknown): void;
5663
- hasValue(key: string): boolean;
5664
- removeValue(key: string): void;
5665
- }
5666
- export interface AttitudeMap {
5667
- getAttitude(groupIndex: number, targetGroupIndex: number): number;
5668
- getAttitudeGroupCount(): number;
5669
- }
5670
- export interface ItemAttitudeMap {
5671
- getAttitude(groupIndex: number, itemIndex: number): number;
5672
- getAttitudeGroupCount(): number;
5673
- }
5674
- export interface BeaconSupport {
5675
- }
5676
- export interface NPCBlockEventSupport {
5677
- }
5678
- export interface NPCEntityEventSupport {
5679
- }
5680
- export interface Timers {
5681
- }
5682
- export interface StateEvaluator {
5683
- }
5684
- export interface ValueStore {
5685
- getValue(key: string): unknown;
5686
- setValue(key: string, value: unknown): void;
5687
- hasValue(key: string): boolean;
5688
- removeValue(key: string): void;
5689
- }
5690
- export interface Model {
5691
- getId(): string;
5692
- getModelAssetId(): string;
5693
- getScale(): number;
5694
- getRandomAttachmentIds(): string[] | null;
5695
- toReference(): unknown;
5696
- }
5697
- export interface ModelStatic {
5698
- createScaledModel(modelAsset: ModelAsset, scale: number, randomAttachmentIds: string[] | null): Model;
5699
- }
5700
- export interface ModelAsset {
5701
- getId(): string;
5702
- }
5703
- export interface JavaPair<F, S> {
5704
- first(): F;
5705
- second(): S;
5706
- }
5707
- export interface JavaPairStatic {
5708
- of<F, S>(first: F, second: S): JavaPair<F, S>;
5709
- }
5710
- export type TriConsumer<A, B, C> = (a: A, b: B, c: C) => void;
5711
- export interface ResourceType<S, R> {
5712
- }
5713
- export interface SpatialResource<S> {
5714
- }
5715
- export interface SpawningPlugin {
5716
- get(): SpawningPlugin;
5717
- }
5718
- export interface SpawningPluginStatic {
5719
- get(): SpawningPlugin;
5720
- }
5721
- export interface FlockPlugin {
5722
- get(): FlockPlugin;
5723
- trySpawnFlock(npcRef: Ref<EntityStore>, npcComponent: NPCEntity, store: Store<EntityStore>, roleIndex: number, position: Vector3d, rotation: Vector3f, flockDefinition: FlockAsset | null, postSpawn: TriConsumer<NPCEntity, Ref<EntityStore>, Store<EntityStore>> | null): void;
5724
- }
5725
- export interface FlockPluginStatic {
5726
- get(): FlockPlugin;
5727
- trySpawnFlock(npcRef: Ref<EntityStore>, npcComponent: NPCEntity, store: Store<EntityStore>, roleIndex: number, position: Vector3d, rotation: Vector3f, flockDefinition: FlockAsset | null, postSpawn: TriConsumer<NPCEntity, Ref<EntityStore>, Store<EntityStore>> | null): void;
5728
- }
5729
- export interface FlockAsset {
5730
- getId(): string;
5731
- }
5732
- export interface FlockAssetStatic {
5733
- getAssetMap(): IndexedLookupTableAssetMap<string, FlockAsset>;
5734
- }
5735
- export interface IndexedLookupTableAssetMap<K, V> {
5736
- getIndex(key: K): number;
5737
- getAsset(key: K): V | null;
5738
- getAssetOrDefault(index: number, defaultValue: V | null): V | null;
5739
- }
5740
- export interface UseNPCInteraction {
5741
- DEFAULT_ID: string;
5742
- DEFAULT_ROOT: unknown;
5743
- }
5744
- export interface SpawnNPCInteraction {
5745
- }
5746
- export interface ContextualUseNPCInteraction {
5747
- }
5748
- export interface NPCSpawnEvent {
5749
- toString(): string;
5750
- getNpcRef(): Ref<EntityStore>;
5751
- getNpcEntity(): NPCEntity;
5752
- getStore(): Store<EntityStore>;
5753
- getRoleIndex(): number;
5754
- getRoleName(): string;
5755
- getPosition(): Vector3d;
5756
- getRotation(): Vector3f;
5757
- isCancelled(): boolean;
5758
- setCancelled(cancelled: boolean): void;
5759
- }
5760
- export interface NPCDespawnEvent {
5761
- toString(): string;
5762
- getNpcRef(): Ref<EntityStore>;
5763
- getNpcEntity(): NPCEntity;
5764
- getStore(): Store<EntityStore>;
5765
- getRoleIndex(): number;
5766
- getRoleName(): string;
5767
- }
5768
- export interface NPCRoleChangeEvent {
5769
- toString(): string;
5770
- getNpcRef(): Ref<EntityStore>;
5771
- getNpcEntity(): NPCEntity;
5772
- getOldRoleIndex(): number;
5773
- getNewRoleIndex(): number;
5774
- getOldRoleName(): string;
5775
- getNewRoleName(): string;
5776
- }
5777
- export interface NPCDamageEvent {
5778
- toString(): string;
5779
- getNpcRef(): Ref<EntityStore>;
5780
- getNpcEntity(): NPCEntity;
5781
- getDamageSource(): Ref<EntityStore> | null;
5782
- getDamageAmount(): number;
5783
- isCancelled(): boolean;
5784
- setCancelled(cancelled: boolean): void;
5785
- setDamageAmount(amount: number): void;
5786
- }
5787
- export interface NPCDeathEvent {
5788
- toString(): string;
5789
- getNpcRef(): Ref<EntityStore>;
5790
- getNpcEntity(): NPCEntity;
5791
- getKillerRef(): Ref<EntityStore> | null;
5792
- }
5793
- export interface EventTitleUtil {
5794
- DEFAULT_ZONE: string;
5795
- DEFAULT_DURATION: number;
5796
- DEFAULT_FADE_DURATION: number;
5797
- /**
5798
- * @param primaryTitle O título principal.
5799
- * @param secondaryTitle O título secundário.
5800
- * @param isMajor Se o título é major.
5801
- * @param icon O ícone a ser exibido.
5802
- * @param duration A duração do título.
5803
- * @param fadeInDuration A duração do fade in.
5804
- * @param fadeOutDuration A duração do fade out.
5805
- */
5806
- showEventTitleToUniverse(primaryTitle: Message, secondaryTitle: Message, isMajor: boolean, icon: string | null, duration: number, fadeInDuration: number, fadeOutDuration: number): void;
5807
- /**
5808
- * @param primaryTitle O título principal.
5809
- * @param secondaryTitle O título secundário.
5810
- * @param isMajor Se o título é major.
5811
- * @param icon O ícone a ser exibido.
5812
- * @param duration A duração do título.
5813
- * @param fadeInDuration A duração do fade in.
5814
- * @param fadeOutDuration A duração do fade out.
5815
- * @param store Referência do mundo.
5816
- */
5817
- showEventTitleToWorld(primaryTitle: Message, secondaryTitle: Message, isMajor: boolean, icon: string | null, duration: number, fadeInDuration: number, fadeOutDuration: number, store: unknown): void;
5818
- /**
5819
- * @param fadeOutDuration A duração do fade out.
5820
- * @param store Referência do mundo.
5821
- */
5822
- hideEventTitleFromWorld(fadeOutDuration: number, store: unknown): void;
5823
- /**
5824
- * @param playerRef Referência do Jogador que deseja mostrar o título.
5825
- * @param primaryTitle O título principal.
5826
- * @param secondaryTitle O título secundário.
5827
- * @param isMajor Se o título é major.
5828
- * @param icon O ícone a ser exibido.
5829
- * @param duration A duração do título.
5830
- * @param fadeInDuration A duração do fade in.
5831
- * @param fadeOutDuration A duração do fade out.
5832
- */
5833
- showEventTitleToPlayer(playerRef: PlayerRef, primaryTitle: Message, secondaryTitle: Message, isMajor: boolean, icon: string | null, duration: number, fadeInDuration: number, fadeOutDuration: number): void;
5834
- /**
5835
- * Shows an event title to a specific player with default durations.
5836
- */
5837
- showEventTitleToPlayer(playerRef: PlayerRef, primaryTitle: Message, secondaryTitle: Message, isMajor: boolean): void;
5838
- /**
5839
- * Hides the event title from a specific player.
5840
- */
5841
- hideEventTitleFromPlayer(playerRef: PlayerRef, fadeOutDuration: number): void;
5121
+ export interface EventTitleUtil {
5122
+ DEFAULT_ZONE: string;
5123
+ DEFAULT_DURATION: number;
5124
+ DEFAULT_FADE_DURATION: number;
5125
+ /**
5126
+ * @param primaryTitle O título principal.
5127
+ * @param secondaryTitle O título secundário.
5128
+ * @param isMajor Se o título é major.
5129
+ * @param icon O ícone a ser exibido.
5130
+ * @param duration A duração do título.
5131
+ * @param fadeInDuration A duração do fade in.
5132
+ * @param fadeOutDuration A duração do fade out.
5133
+ */
5134
+ showEventTitleToUniverse(primaryTitle: Message, secondaryTitle: Message, isMajor: boolean, icon: string | null, duration: number, fadeInDuration: number, fadeOutDuration: number): void;
5135
+ /**
5136
+ * @param primaryTitle O título principal.
5137
+ * @param secondaryTitle O título secundário.
5138
+ * @param isMajor Se o título é major.
5139
+ * @param icon O ícone a ser exibido.
5140
+ * @param duration A duração do título.
5141
+ * @param fadeInDuration A duração do fade in.
5142
+ * @param fadeOutDuration A duração do fade out.
5143
+ * @param store Referência do mundo.
5144
+ */
5145
+ showEventTitleToWorld(primaryTitle: Message, secondaryTitle: Message, isMajor: boolean, icon: string | null, duration: number, fadeInDuration: number, fadeOutDuration: number, store: unknown): void;
5146
+ /**
5147
+ * @param fadeOutDuration A duração do fade out.
5148
+ * @param store Referência do mundo.
5149
+ */
5150
+ hideEventTitleFromWorld(fadeOutDuration: number, store: unknown): void;
5151
+ /**
5152
+ * @param playerRef Referência do Jogador que deseja mostrar o título.
5153
+ * @param primaryTitle O título principal.
5154
+ * @param secondaryTitle O título secundário.
5155
+ * @param isMajor Se o título é major.
5156
+ * @param icon O ícone a ser exibido.
5157
+ * @param duration A duração do título.
5158
+ * @param fadeInDuration A duração do fade in.
5159
+ * @param fadeOutDuration A duração do fade out.
5160
+ */
5161
+ showEventTitleToPlayer(playerRef: PlayerRef, primaryTitle: Message, secondaryTitle: Message, isMajor: boolean, icon: string | null, duration: number, fadeInDuration: number, fadeOutDuration: number): void;
5162
+ /**
5163
+ * Shows an event title to a specific player with default durations.
5164
+ */
5165
+ showEventTitleToPlayer(playerRef: PlayerRef, primaryTitle: Message, secondaryTitle: Message, isMajor: boolean): void;
5166
+ /**
5167
+ * Hides the event title from a specific player.
5168
+ */
5169
+ hideEventTitleFromPlayer(playerRef: PlayerRef, fadeOutDuration: number): void;
5842
5170
  }
5843
5171
  declare global {
5844
5172
  const Java: JavaInterop;
@@ -5866,19 +5194,6 @@ declare global {
5866
5194
  const SoundEvent: SoundEventClass;
5867
5195
  const SoundCategory: SoundCategoryEnum;
5868
5196
  const PlaySoundEvent2D: PlaySoundEvent2D;
5869
- const UICommandBuilder: UICommandBuilderStatic;
5870
- const UIEventBuilder: UIEventBuilderStatic;
5871
- const EventData: EventDataStatic;
5872
- const Value: ValueStatic;
5873
- const CustomUIEventBindingType: CustomUIEventBindingTypeEnum;
5874
- const CustomPageLifetime: CustomPageLifetimeEnum;
5875
- const CustomUICommandType: CustomUICommandTypeEnum;
5876
- const HudComponent: HudComponentEnum;
5877
- const Page: PageEnum;
5878
- const ScriptCustomUIPage: ScriptCustomUIPageStatic;
5879
- const ScriptCustomUIHud: ScriptCustomUIHudStatic;
5880
- const ByteArrayCommonAsset: ByteArrayCommonAssetStatic;
5881
- const CommonAssetModule: CommonAssetModuleStatic;
5882
5197
  const DynamicLight: DynamicLight;
5883
5198
  const PersistentDynamicLight: PersistentDynamicLight;
5884
5199
  const Position: Position;
@@ -6416,18 +5731,383 @@ declare global {
6416
5731
  const WhitelistListCommand: WhitelistListCommand;
6417
5732
  const WhitelistRemoveCommand: WhitelistRemoveCommand;
6418
5733
  const WhitelistStatusCommand: WhitelistStatusCommand;
5734
+ const EventTitleUtil: EventTitleUtil;
5735
+ const MySQLManager: MySQLManager;
5736
+ const TableBuilder: TableBuilderConstructor;
5737
+ }
5738
+ export interface JavaSet<T> {
5739
+ add(e: T): boolean;
5740
+ clear(): void;
5741
+ contains(o: unknown): boolean;
5742
+ isEmpty(): boolean;
5743
+ iterator(): unknown;
5744
+ remove(o: unknown): boolean;
5745
+ size(): number;
5746
+ toArray(): T[];
5747
+ }
5748
+ export interface PageManager {
5749
+ setActiveCustomPage(arg0: PlayerRef, arg1: ScriptCustomUIPage | null): void;
5750
+ getActiveCustomPage(): ScriptCustomUIPage | null;
5751
+ }
5752
+ export interface HudManager {
5753
+ setCustomHud(arg0: PlayerRef, arg1: ScriptCustomUIHud | null): void;
5754
+ getCustomHud(): ScriptCustomUIHud | null;
5755
+ }
5756
+ export interface ScriptCustomUIHud {
5757
+ triggerShow(): void;
5758
+ triggerUpdate(commandBuilder: UICommandBuilder): void;
5759
+ triggerUpdate(commandBuilder: UICommandBuilder, clear: boolean): void;
5760
+ }
5761
+ export interface ScriptCustomUIPage {
5762
+ triggerRebuild(): void;
5763
+ triggerSendUpdate(): void;
5764
+ triggerSendUpdate(commandBuilder: UICommandBuilder): void;
5765
+ triggerSendUpdate(commandBuilder: UICommandBuilder, clear: boolean): void;
5766
+ triggerClose(): void;
5767
+ getPlayerRef(): PlayerRef;
5768
+ getPageLifetime(): unknown;
5769
+ setPageLifetime(lifetime: unknown): void;
5770
+ }
5771
+ export interface UICommandBuilder {
5772
+ append(path: string): UICommandBuilder;
5773
+ set(selector: string, value: string): UICommandBuilder;
5774
+ set(selector: string, value: number): UICommandBuilder;
5775
+ set(selector: string, value: boolean): UICommandBuilder;
5776
+ }
5777
+ export interface UIEventBuilder {
5778
+ on(eventName: string, callback: string): UIEventBuilder;
5779
+ }
5780
+ export interface ByteArrayCommonAsset {
5781
+ getName(): string;
5782
+ getHash(): string;
5783
+ }
5784
+ export interface ByteArrayCommonAssetConstructor {
5785
+ new (name: string, bytes: unknown): ByteArrayCommonAsset;
5786
+ new (name: string, content: string): ByteArrayCommonAsset;
5787
+ }
5788
+ export interface ScriptCustomUIHudConstructor {
5789
+ new (playerRef: PlayerRef, buildCallback: (cmd: UICommandBuilder) => void): ScriptCustomUIHud;
5790
+ }
5791
+ export interface ScriptCustomUIPageConstructor {
5792
+ new (playerRef: PlayerRef, lifetime: unknown, buildCallback: (ref: Ref, cmd: UICommandBuilder, evt: UIEventBuilder, store: unknown) => void, eventCallback?: (ref: Ref, store: unknown, rawData: string) => void, dismissCallback?: (ref: Ref, store: unknown) => void): ScriptCustomUIPage;
5793
+ }
5794
+ export interface CommonAssetModule {
5795
+ get(): CommonAssetModule;
5796
+ addCommonAsset(namespace: string, asset: ByteArrayCommonAsset): void;
5797
+ }
5798
+ export interface LivingEntity extends Entity {
5799
+ getInventory(): Inventory;
5800
+ setInventory(inventory: Inventory): Inventory;
5801
+ getStatMap(): EntityStatMap | null;
5802
+ }
5803
+ export interface NPCEntity extends LivingEntity {
5804
+ getRole(): Role | null;
5805
+ getRoleIndex(): number;
5806
+ getRoleName(): string | null;
5807
+ setRoleName(roleName: string): void;
5808
+ setRoleIndex(roleIndex: number): void;
5809
+ getLeashPoint(): Vector3d;
5810
+ setLeashPoint(leashPoint: Vector3d): void;
5811
+ getLeashHeading(): number;
5812
+ getLeashPitch(): number;
5813
+ saveLeashInformation(position: Vector3d, rotation: Vector3f): void;
5814
+ getAlarmStore(): AlarmStore;
5815
+ getDamageData(): DamageData;
5816
+ clearDamageData(): void;
5817
+ setToDespawn(): void;
5818
+ setDespawnTime(time: number): void;
5819
+ getDespawnTime(): number;
5820
+ setDespawning(despawning: boolean): void;
5821
+ setPlayingDespawnAnim(playingDespawnAnim: boolean): void;
5822
+ setDespawnRemainingSeconds(seconds: number): void;
5823
+ setDespawnCheckRemainingSeconds(seconds: number): void;
5824
+ setDespawnAnimationRemainingSeconds(seconds: number): void;
5825
+ setInitialModelScale(scale: number): void;
5826
+ getOldPosition(): Vector3d;
5827
+ playAnimation(ref: Ref, animationSlot: AnimationSlot, animationId: string | null, componentAccessor: ComponentAccessor): void;
5828
+ onFlockSetState(ref: Ref, state: string, subState: string | null, componentAccessor: ComponentAccessor): void;
5829
+ onFlockSetTarget(targetSlot: string, target: Ref): void;
5830
+ getSpawnInstant(): unknown;
5831
+ setSpawnInstant(instant: unknown): void;
5832
+ getEnvironmentIndex(): number;
5833
+ getSpawnConfigurationIndex(): number;
5834
+ isSpawnTracked(): boolean;
5835
+ setSpawnTracked(tracked: boolean): void;
5836
+ }
5837
+ export interface NPCEntityStatic {
5838
+ getComponentType(): ComponentType | null;
5839
+ CODEC: unknown;
5840
+ }
5841
+ export interface Role {
5842
+ getRoleIndex(): number;
5843
+ getRoleName(): string;
5844
+ getCombatSupport(): CombatSupport;
5845
+ getStateSupport(): StateSupport;
5846
+ getMarkedEntitySupport(): MarkedEntitySupport;
5847
+ getWorldSupport(): WorldSupport;
5848
+ getEntitySupport(): EntitySupport;
5849
+ getPositionCache(): PositionCache;
5850
+ getDebugSupport(): DebugSupport;
5851
+ isActivated(): boolean;
5852
+ isRoleChangeRequested(): boolean;
5853
+ canBreathe(breathingMaterial: unknown, fluidId: number): boolean;
5854
+ requiresLeashPosition(): boolean;
5855
+ setMarkedTarget(targetSlot: string, target: Ref): void;
5856
+ getAppearance(): string;
5857
+ getInitialMaxHealth(): number;
5858
+ getCollisionRadius(): number;
5859
+ isInvulnerable(): boolean;
5860
+ getDeathAnimationTime(): number;
5861
+ getDespawnAnimationTime(): number;
5862
+ getDropListId(): string;
5863
+ getDeathInteraction(): string | null;
5864
+ getInventorySlots(): number;
5865
+ getHotbarSlots(): number;
5866
+ getOffHandSlots(): number;
5867
+ getFlockSpawnTypes(): string[] | null;
5868
+ getFlockAllowedRoles(): string[];
5869
+ canLeadFlock(): boolean;
5870
+ isCorpseStaysInFlock(): boolean;
5871
+ getInertia(): number;
5872
+ getKnockbackScale(): number;
5873
+ isBreathesInAir(): boolean;
5874
+ isBreathesInWater(): boolean;
5875
+ isPickupDropOnDeath(): boolean;
5876
+ getBalanceAsset(): string | null;
5877
+ getSpawnLockTime(): number;
5878
+ getNameTranslationKey(): string;
5879
+ }
5880
+ export interface CombatSupport {
5881
+ getCanCauseDamage(attackerRef: Ref, componentAccessor: ComponentAccessor): boolean;
5882
+ }
5883
+ export interface StateSupport {
5884
+ setState(ref: Ref, state: string, subState: string | null, componentAccessor: ComponentAccessor): void;
5885
+ getState(): string | null;
5886
+ getSubState(): string | null;
5887
+ addInteraction(ref: Ref, interactionRef: Ref, componentAccessor: ComponentAccessor): void;
5888
+ willInteractWith(ref: Ref): boolean;
5889
+ }
5890
+ export interface MarkedEntitySupport {
5891
+ getMarkedTarget(targetSlot: string): Ref | null;
5892
+ setMarkedTarget(targetSlot: string, target: Ref): void;
5893
+ clearMarkedTarget(targetSlot: string): void;
5894
+ hasMarkedTarget(targetSlot: string): boolean;
5895
+ }
5896
+ export interface WorldSupport {
5897
+ getWorld(): World;
5898
+ }
5899
+ export interface EntitySupport {
5900
+ getDisplayName(): string | null;
5901
+ setDisplayName(ref: Ref, displayName: string, componentAccessor: ComponentAccessor): void;
5902
+ }
5903
+ export interface PositionCache {
5904
+ getPosition(): Vector3d;
5905
+ getRotation(): Vector3f;
5906
+ }
5907
+ export interface DebugSupport {
5908
+ isDebugEnabled(): boolean;
5909
+ setDebugEnabled(enabled: boolean): void;
5910
+ }
5911
+ export interface AlarmStore {
5912
+ getAlarm(alarmId: string): number;
5913
+ setAlarm(alarmId: string, time: number): void;
5914
+ removeAlarm(alarmId: string): void;
5915
+ hasAlarm(alarmId: string): boolean;
5916
+ }
5917
+ export interface DamageData {
5918
+ reset(): void;
5919
+ getLastDamageSource(): Ref | null;
5920
+ getLastDamageAmount(): number;
5921
+ getLastDamageTime(): number;
5922
+ getTotalDamageReceived(): number;
5923
+ }
5924
+ export interface AnimationSlot {
5925
+ ordinal(): number;
5926
+ name(): string;
5927
+ }
5928
+ export interface AnimationSlotEnum {
5929
+ Action: AnimationSlot;
5930
+ Base: AnimationSlot;
5931
+ Emote: AnimationSlot;
5932
+ values(): AnimationSlot[];
5933
+ valueOf(name: string): AnimationSlot;
5934
+ }
5935
+ export interface NPCPlugin {
5936
+ get(): NPCPlugin;
5937
+ getIndex(builderName: string): number;
5938
+ getName(builderIndex: number): string | null;
5939
+ hasRoleName(roleName: string): boolean;
5940
+ validateSpawnableRole(roleName: string): void;
5941
+ getRoleTemplateNames(spawnableOnly: boolean): string[];
5942
+ tryGetCachedValidRole(roleIndex: number): Builder | null;
5943
+ getRoleBuilderInfo(roleIndex: number): BuilderInfo | null;
5944
+ spawnNPC(store: unknown, npcType: string, groupType: string | null, position: Vector3d, rotation: Vector3f): JavaPair | null;
5945
+ spawnEntity(store: unknown, roleIndex: number, position: Vector3d, rotation: Vector3f | null, spawnModel: Model | null, postSpawn: TriConsumer | null): JavaPair | null;
5946
+ getBlackboardResourceType(): unknown;
5947
+ getNpcSpatialResource(): unknown;
5948
+ getAttitudeMap(): AttitudeMap;
5949
+ getItemAttitudeMap(): ItemAttitudeMap;
5950
+ getBuilderManager(): BuilderManager;
5951
+ getBeaconSupportComponentType(): ComponentType;
5952
+ getNpcBlockEventSupportComponentType(): ComponentType;
5953
+ getNpcEntityEventSupportComponentType(): ComponentType;
5954
+ getTimersComponentType(): ComponentType;
5955
+ getStateEvaluatorComponentType(): ComponentType;
5956
+ getValueStoreComponentType(): ComponentType;
5957
+ }
5958
+ export interface NPCPluginStatic {
5959
+ get(): NPCPlugin;
5960
+ reloadNPCsWithRole(roleIndex: number): void;
5961
+ buildRole(roleBuilder: Builder, builderInfo: BuilderInfo, builderSupport: BuilderSupport, roleIndex: number): Role;
5962
+ }
5963
+ export interface INonPlayerCharacter {
5964
+ getRole(): Role | null;
5965
+ getRoleIndex(): number;
5966
+ }
5967
+ export interface Builder {
5968
+ build2(builderSupport: BuilderSupport): unknown;
5969
+ getBuilderParameters(): unknown;
5970
+ category(): unknown;
5971
+ isSpawnable(): boolean;
5972
+ }
5973
+ export interface BuilderInfo {
5974
+ getKeyName(): string;
5975
+ getBuilder(): Builder;
5976
+ isValid(): boolean;
5977
+ isValidated(): boolean;
5978
+ setNeedsReload(): void;
5979
+ }
5980
+ export interface BuilderSupport {
5981
+ setScope(scope: unknown): void;
5982
+ setGlobalScope(scope: unknown): void;
5983
+ }
5984
+ export interface BuilderManager {
5985
+ getIndex(builderName: string): number;
5986
+ lookupName(builderIndex: number): string | null;
5987
+ tryGetCachedValidRole(roleIndex: number): Builder | null;
5988
+ tryGetBuilderInfo(builderIndex: number): BuilderInfo | null;
5989
+ getCachedBuilderInfo(roleIndex: number, category: unknown): BuilderInfo;
5990
+ validateBuilder(builderInfo: BuilderInfo): boolean;
5991
+ forceValidation(builderIndex: number): void;
5992
+ }
5993
+ export interface Blackboard {
5994
+ getValue(key: string): unknown;
5995
+ setValue(key: string, value: unknown): void;
5996
+ hasValue(key: string): boolean;
5997
+ removeValue(key: string): void;
5998
+ }
5999
+ export interface AttitudeMap {
6000
+ getAttitude(groupIndex: number, targetGroupIndex: number): number;
6001
+ getAttitudeGroupCount(): number;
6002
+ }
6003
+ export interface ItemAttitudeMap {
6004
+ getAttitude(groupIndex: number, itemIndex: number): number;
6005
+ getAttitudeGroupCount(): number;
6006
+ }
6007
+ export interface Model {
6008
+ getId(): string;
6009
+ getModelAssetId(): string;
6010
+ getScale(): number;
6011
+ getRandomAttachmentIds(): string[] | null;
6012
+ toReference(): unknown;
6013
+ }
6014
+ export interface ModelStatic {
6015
+ createScaledModel(modelAsset: ModelAsset, scale: number, randomAttachmentIds: string[] | null): Model;
6016
+ }
6017
+ export interface ModelAsset {
6018
+ getId(): string;
6019
+ }
6020
+ export interface JavaPair {
6021
+ first(): unknown;
6022
+ second(): unknown;
6023
+ }
6024
+ export interface JavaPairStatic {
6025
+ of(first: unknown, second: unknown): JavaPair;
6026
+ }
6027
+ export type TriConsumer = (a: unknown, b: unknown, c: unknown) => void;
6028
+ export interface FlockPlugin {
6029
+ get(): FlockPlugin;
6030
+ trySpawnFlock(npcRef: Ref, npcComponent: NPCEntity, store: unknown, roleIndex: number, position: Vector3d, rotation: Vector3f, flockDefinition: FlockAsset | null, postSpawn: TriConsumer | null): void;
6031
+ }
6032
+ export interface FlockPluginStatic {
6033
+ get(): FlockPlugin;
6034
+ trySpawnFlock(npcRef: Ref, npcComponent: NPCEntity, store: unknown, roleIndex: number, position: Vector3d, rotation: Vector3f, flockDefinition: FlockAsset | null, postSpawn: TriConsumer | null): void;
6035
+ }
6036
+ export interface FlockAsset {
6037
+ getId(): string;
6038
+ }
6039
+ export interface SpawningPlugin {
6040
+ get(): SpawningPlugin;
6041
+ }
6042
+ export interface SpawningPluginStatic {
6043
+ get(): SpawningPlugin;
6044
+ }
6045
+ export interface NPCSpawnEvent {
6046
+ toString(): string;
6047
+ getNpcRef(): Ref;
6048
+ getNpcEntity(): NPCEntity;
6049
+ getStore(): unknown;
6050
+ getRoleIndex(): number;
6051
+ getRoleName(): string;
6052
+ getPosition(): Vector3d;
6053
+ getRotation(): Vector3f;
6054
+ isCancelled(): boolean;
6055
+ setCancelled(cancelled: boolean): void;
6056
+ }
6057
+ export interface NPCDespawnEvent {
6058
+ toString(): string;
6059
+ getNpcRef(): Ref;
6060
+ getNpcEntity(): NPCEntity;
6061
+ getStore(): unknown;
6062
+ getRoleIndex(): number;
6063
+ getRoleName(): string;
6064
+ }
6065
+ export interface NPCRoleChangeEvent {
6066
+ toString(): string;
6067
+ getNpcRef(): Ref;
6068
+ getNpcEntity(): NPCEntity;
6069
+ getOldRoleIndex(): number;
6070
+ getNewRoleIndex(): number;
6071
+ getOldRoleName(): string;
6072
+ getNewRoleName(): string;
6073
+ }
6074
+ export interface NPCDamageEvent {
6075
+ toString(): string;
6076
+ getNpcRef(): Ref;
6077
+ getNpcEntity(): NPCEntity;
6078
+ getDamageSource(): Ref | null;
6079
+ getDamageAmount(): number;
6080
+ isCancelled(): boolean;
6081
+ setCancelled(cancelled: boolean): void;
6082
+ setDamageAmount(amount: number): void;
6083
+ }
6084
+ export interface NPCDeathEvent {
6085
+ toString(): string;
6086
+ getNpcRef(): Ref;
6087
+ getNpcEntity(): NPCEntity;
6088
+ getKillerRef(): Ref | null;
6089
+ }
6090
+ declare global {
6091
+ const ByteArrayCommonAsset: ByteArrayCommonAssetConstructor;
6092
+ const ScriptCustomUIHud: ScriptCustomUIHudConstructor;
6093
+ const ScriptCustomUIPage: ScriptCustomUIPageConstructor;
6094
+ const UICommandBuilder: {
6095
+ new (): UICommandBuilder;
6096
+ };
6097
+ const UIEventBuilder: {
6098
+ new (): UIEventBuilder;
6099
+ };
6100
+ const CommonAssetModule: CommonAssetModule;
6101
+ const CustomPageLifetime: {
6102
+ PERSISTENT: unknown;
6103
+ TEMPORARY: unknown;
6104
+ };
6419
6105
  const NPCPlugin: NPCPluginStatic;
6420
6106
  const NPCEntity: NPCEntityStatic;
6421
6107
  const FlockPlugin: FlockPluginStatic;
6422
- const FlockAsset: FlockAssetStatic;
6423
6108
  const SpawningPlugin: SpawningPluginStatic;
6424
6109
  const AnimationSlot: AnimationSlotEnum;
6425
6110
  const Model: ModelStatic;
6426
6111
  const Pair: JavaPairStatic;
6427
- const AddReason: AddReasonEnum;
6428
- const RemoveReason: RemoveReasonEnum;
6429
- const EventTitleUtil: EventTitleUtil;
6430
- const MySQLManager: MySQLManager;
6431
- const TableBuilder: TableBuilderConstructor;
6432
6112
  }
6433
6113
  //# sourceMappingURL=types.d.ts.map