Skip to content
LeviMC
English
AutoLightDark
LeviLamina
Loading...
Searching...
No Matches
Player.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4#include "mc/deps/certificates/Certificate.h"
5#include "mc/entity/components/UserEntityIdentifierComponent.h"
6#include "mc/network/NetworkPeer.h"
7#include "mc/world/inventory/EnderChestContainer.h"
8
9// auto generated inclusion list
10#include "mc/certificates/identity/PlayerAuthenticationType.h"
11#include "mc/common/SubClientId.h"
12#include "mc/deps/core/math/Vec3.h"
13#include "mc/deps/core/platform/BuildPlatform.h"
14#include "mc/deps/core/timing/Stopwatch.h"
15#include "mc/deps/core/utility/DefaultSmallOptionalTraits.h"
16#include "mc/deps/core/utility/NonOwnerPointer.h"
17#include "mc/deps/core/utility/SmallOptional.h"
18#include "mc/deps/core/utility/optional_ref.h"
19#include "mc/deps/core/utility/pub_sub/Publisher.h"
20#include "mc/deps/game_refs/OwnerPtr.h"
21#include "mc/deps/shared_types/legacy/LevelSoundEvent.h"
22#include "mc/deps/shared_types/legacy/actor/ActorDamageCause.h"
23#include "mc/deps/shared_types/legacy/actor/ArmorSlot.h"
24#include "mc/entity/components/PlayerPositionModeComponent.h"
25#include "mc/legacy/ActorUniqueID.h"
26#include "mc/server/commands/CommandPermissionLevel.h"
27#include "mc/server/commands/PlayerPermissionLevel.h"
28#include "mc/world/PlayerUIContainer.h"
29#include "mc/world/actor/ActorEvent.h"
30#include "mc/world/actor/ActorInitializationMethod.h"
31#include "mc/world/actor/ActorResetRule.h"
32#include "mc/world/actor/ActorType.h"
33#include "mc/world/actor/Mob.h"
34#include "mc/world/actor/bhave/BehaviorStatus.h"
35#include "mc/world/actor/player/AbilitiesIndex.h"
36#include "mc/world/actor/player/ActorInteractionHandResult.h"
37#include "mc/world/actor/player/BedSleepingResult.h"
38#include "mc/world/actor/player/PlayerItemInUse.h"
39#include "mc/world/actor/player/PlayerSpawnFallbackType.h"
40#include "mc/world/actor/player/PlayerUISlot.h"
41#include "mc/world/inventory/FurnaceOptions.h"
42#include "mc/world/inventory/InventoryOptions.h"
43#include "mc/world/inventory/transaction/InventoryTransactionManager.h"
44#include "mc/world/item/HandSlot.h"
45#include "mc/world/item/ItemGroup.h"
46#include "mc/world/item/ItemInstance.h"
47#include "mc/world/item/ItemUseMethod.h"
48#include "mc/world/level/BlockPos.h"
49#include "mc/world/level/GameType.h"
50#include "mc/world/level/dimension/DimensionType.h"
51
52// auto generated forward declare list
53// clang-format off
54class AABB;
55class Actor;
57class ActorHurtResult;
58class Agent;
60class Attribute;
61class Block;
62class BlockActor;
63class BlockSource;
64class BodyControl;
66class ChunkPos;
67class ChunkSource;
68class ChunkViewSource;
70class CompoundTag;
71class Container;
73class DataLoadHelper;
75class EntityContext;
76class GameMode;
78class HashedString;
82class ILevel;
87class Item;
88class ItemDescriptor;
89class ItemStack;
90class ItemStackBase;
96class Packet;
97class PacketSender;
98class PersonaPiece;
100class PlayerInventory;
104class SubChunkPos;
105class TextObjectRoot;
106class Vec2;
107struct AABBShapeComponent;
109struct BiomeIdType;
110struct HurtParameters;
111struct INpcDialogueData;
115struct PlayerPartyInfo;
118struct Tick;
120namespace Bedrock::PubSub::ThreadModel { struct SingleThreaded; }
121namespace Editor { class IEditorPlayer; }
122namespace mce { class Color; }
123namespace mce { class UUID; }
125class PlayerListener;
126// clang-format on
127
129class Inventory;
130
131class Player : public ::Mob {
132public:
133 // Player inner types declare
134 // clang-format off
135 struct AttackParameters;
136 struct CachedSpawnData;
139 struct PlayerSpawnPoint;
140 // clang-format on
141
142 // Player inner types define
143 enum class SpawnPositionSource : int {
144 Randomizer = 0,
145 Respawn = 1,
146 Teleport = 2,
147 Static = 3,
148 };
149
150 enum class SpawnPositionState : int {
151 InitializeSpawnPositionRandomizer = 0,
152 WaitForClientAck = 1,
153 DetermineDimension = 2,
154 ChangeDimension = 3,
155 WaitForDimension = 4,
156 ChooseSpawnArea = 5,
157 CheckLoadedChunk = 6,
158 ChooseSpawnPosition = 7,
159 SpawnComplete = 8,
160 };
161
163 public:
164 // AttackParameters inner types define
165 enum class Sound : int {
166 None = 0,
167 Predictive = 1,
168 NonPredictive = 2,
169 };
170
171 public:
172 // member variables
173 // NOLINTBEGIN
174 ::ll::TypedStorage<4, 4, ::Player::AttackParameters::Sound> mSound;
175 ::ll::TypedStorage<1, 1, bool> mTriggerCooldown;
176 ::ll::TypedStorage<1, 1, bool> mCanCrit;
177 ::ll::TypedStorage<4, 16, ::std::optional<::Vec3>> mAimDirection;
178 // NOLINTEND
179 };
180
182 public:
183 // member variables
184 // NOLINTBEGIN
185 ::ll::TypedStorage<4, 4, ::DimensionType> mRespawnDimensionId;
186 ::ll::TypedStorage<4, 12, ::Vec3> mActualRespawnPosition;
187 ::ll::TypedStorage<4, 12, ::BlockPos> mRequestedRespawnPosition;
188 ::ll::TypedStorage<1, 1, bool> mHasRespawnPosition;
189 ::ll::TypedStorage<4, 12, ::BlockPos> mSharedSpawnPosition;
190 ::ll::TypedStorage<1, 1, bool> mRespawnReady;
191 ::ll::TypedStorage<4, 12, ::Vec3> mPlayerPos;
192 ::ll::TypedStorage<1, 1, bool> mIsForcedRespawn;
193 ::ll::TypedStorage<1, 1, bool> mIsAdventure;
194 ::ll::TypedStorage<1, 1, bool> mIsFlyingOrNotOverworld;
195 ::ll::TypedStorage<1, 1, bool> mPositionLoadedFromSave;
196 // NOLINTEND
197 };
198
200 public:
201 // member variables
202 // NOLINTBEGIN
203 ::ll::TypedStorage<4, 12, ::Vec3> mPosition;
204 ::ll::TypedStorage<4, 4, ::PlayerSpawnFallbackType> mSpawnFallbackType;
205 // NOLINTEND
206 };
207
209 public:
210 // member variables
211 // NOLINTBEGIN
212 ::ll::TypedStorage<4, 12, ::Vec3> mPosition;
213 ::ll::TypedStorage<1, 1, bool> mIsAboveLeaves;
214 // NOLINTEND
215 };
216
218 public:
219 // member variables
220 // NOLINTBEGIN
221 ::ll::TypedStorage<4, 12, ::BlockPos> mSpawnBlockPos;
222 ::ll::TypedStorage<4, 12, ::BlockPos> mPlayerPosition;
223 ::ll::TypedStorage<4, 4, ::DimensionType> mDimension;
224 // NOLINTEND
225 };
226
227 using PlayerFlagIDType = schar;
228
229 using PlayerListenerList = ::std::vector<::PlayerListener*>;
230
231public:
232 LLNDAPI UserEntityIdentifierComponent const& getUserEntityIdentifier() const;
233
234 LLNDAPI UserEntityIdentifierComponent& getUserEntityIdentifier();
235
236 LLNDAPI optional_ref<ConnectionRequest const> getConnectionRequest() const;
237
238 LLNDAPI NetworkIdentifier const& getNetworkIdentifier() const;
239
240 LLNDAPI SubClientId const& getClientSubId() const;
241
242 LLNDAPI int getSelectedItemSlot() const;
243
248 LLNDAPI mce::UUID const& getUuid() const;
249
254 LLNDAPI std::string getIPAndPort() const;
255
260 LLNDAPI std::string getRealName() const;
261
268 LLNDAPI std::string getLocaleCode() const;
269
270 LLNDAPI std::optional<NetworkPeer::NetworkStatus> getNetworkStatus() const;
271
275 LLAPI void disconnect(std::string_view reason) const;
279 LLAPI void sendMessage(std::string_view msg) const;
280
281 LLAPI void setAbility(::AbilitiesIndex index, bool value);
282
290 LLNDAPI bool isOperator() const;
291
302 LLAPI bool addAndRefresh(class ItemStack& item);
303
304 LLNDAPI optional_ref<EnderChestContainer> getEnderChestContainer() const;
305
306 LLNDAPI Inventory& getInventory() const;
307
308 LLNDAPI static Player* tryGetFromEntity(::EntityContext& entity, bool includeRemoved);
309
310 LLNDAPI ItemStack const& getSelectedItem() const;
311
312 LLAPI void setSelectedItem(ItemStack const& item) const;
313
314 LLNDAPI bool canSleep() const;
315
316 LLNDAPI bool isHungry() const;
317
318 LLNDAPI int getXpNeededForNextLevel();
319
320 LLNDAPI int getPreviousLevelRequirement();
321
322 LLNDAPI int getXpEarnedAtCurrentLevel();
323
324 LLNDAPI bool setXpEarnedAtCurrentLevel(int xp);
325
326 LLNDAPI static long long getXpNeededForLevelRange(int startLevel, int endLevel);
327
328public:
329 // member variables
330 // NOLINTBEGIN
331 ::ll::TypedStorage<8, 24, ::std::vector<ushort>> mFroglights;
332 ::ll::TypedStorage<4, 4, float const> mSneakHeight;
333 ::ll::TypedStorage<4, 4, float const> mSneakOffset;
334 ::ll::TypedStorage<4, 4, int> mScore;
335 ::ll::TypedStorage<4, 4, ::BuildPlatform> mBuildPlatform;
336 ::ll::TypedStorage<8, 32, ::std::string> mUniqueName;
337 ::ll::TypedStorage<8, 32, ::std::string> mServerId;
338 ::ll::TypedStorage<8, 32, ::std::string> mSelfSignedId;
339 ::ll::TypedStorage<8, 32, ::std::string> mPlatformOfflineId;
340 ::ll::TypedStorage<8, 8, uint64> mClientRandomId;
341 ::ll::TypedStorage<8, 32, ::std::string> mPlatformId;
342 ::ll::TypedStorage<8, 8, ::ActorUniqueID> mPendingVehicleID;
343 ::ll::TypedStorage<8, 8, ::ActorUniqueID> mPendingLeftShoulderPassengerID;
344 ::ll::TypedStorage<8, 8, ::ActorUniqueID> mPendingRightShoulderPassengerID;
345 ::ll::TypedStorage<8, 8, ::ActorUniqueID> mInteractTarget;
346 ::ll::TypedStorage<4, 12, ::Vec3> mInteractTargetPos;
347 ::ll::TypedStorage<1, 1, bool> mHasFakeInventory;
348 ::ll::TypedStorage<1, 1, bool> mIsRegionSuspended;
349 ::ll::TypedStorage<1, 1, bool> mUpdateMobs;
350 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ChunkViewSource>> mChunkSource;
351 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ChunkViewSource>> mSpawnChunkSource;
352 ::ll::TypedStorage<4, 12, ::Vec3> mCapePosO;
353 ::ll::TypedStorage<4, 12, ::Vec3> mCapePos;
354 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ContainerManagerModel>> mContainerManager;
355 ::ll::TypedStorage<
356 8,
357 8,
358 ::std::unique_ptr<
359 ::Bedrock::PubSub::
361 mContainerManagerSubscribers;
362 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::PlayerInventory>> mInventory;
363 ::ll::TypedStorage<4, 20, ::InventoryOptions> mInventoryOptions;
364 ::ll::TypedStorage<4, 12, ::FurnaceOptions> mFurnaceOptions;
365 ::ll::TypedStorage<4, 12, ::FurnaceOptions> mBlastFurnaceOptions;
366 ::ll::TypedStorage<4, 12, ::FurnaceOptions> mSmokerOptions;
367 ::ll::TypedStorage<4, 4, float> mDistanceSinceTransformEvent;
368 ::ll::TypedStorage<8, 24, ::std::vector<::ItemInstance>> mCreativeItemList;
369 ::ll::TypedStorage<8, 32, ::std::string> mPlatformOnlineId;
370 ::ll::TypedStorage<4, 4, ::Player::SpawnPositionState> mSpawnPositionState;
371 ::ll::TypedStorage<4, 4, ::Player::SpawnPositionSource> mSpawnPositionSource;
372 ::ll::TypedStorage<4, 12, ::Vec3> mSpawnPositioningTestPosition;
373 ::ll::TypedStorage<4, 4, uint> mRespawnChunkBuilderPolicyHandle;
374 ::ll::TypedStorage<4, 64, ::Player::CachedSpawnData> mCachedSpawnData;
375 ::ll::TypedStorage<8, 16, ::OwnerPtr<::BlockSource>> mSpawnBlockSource;
376 ::ll::TypedStorage<8, 56, ::Stopwatch> mRespawnStopwatch_Searching;
377 ::ll::TypedStorage<4, 12, ::Vec3> mRespawnOriginalPosition;
378 ::ll::TypedStorage<4, 4, ::DimensionType> mRespawnOriginalDimension;
379 ::ll::TypedStorage<8, 32, ::std::string> mRespawnMessage;
380 ::ll::TypedStorage<1, 1, bool> mRespawnReady;
381 ::ll::TypedStorage<1, 1, bool> mIsInitialSpawnDone;
382 ::ll::TypedStorage<1, 1, bool> mRespawningFromTheEnd;
383 ::ll::TypedStorage<1, 1, bool> mPositionLoadedFromSave;
384 ::ll::TypedStorage<1, 1, bool> mBlockRespawnUntilClientMessage;
385 ::ll::TypedStorage<1, 1, bool> mHasSeenCredits;
386 ::ll::TypedStorage<4, 8, ::std::optional<::PlayerSpawnFallbackType>> mSpawnFallbackType;
387 ::ll::TypedStorage<4, 16, ::std::optional<::Vec3>> mSpawnFallbackPosition;
388 ::ll::TypedStorage<8, 168, ::PlayerItemInUse> mItemInUse;
389 ::ll::TypedStorage<4, 4, ::ActorType> mLastHurtBy;
390 ::ll::TypedStorage<8, 8, ::ActorUniqueID> mPreviousInteractEntity;
391 ::ll::TypedStorage<4, 4, int> mPreviousCarriedItem;
392 ::ll::TypedStorage<4, 4, int> mEmoteTicks;
393 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::NetworkChunkPublisher>> mChunkPublisherView;
394 ::ll::TypedStorage<8, 8, ::PacketSender&> mPacketSender;
395 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::HudContainerManagerModel>> mHudContainerManagerModel;
396 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::EnderChestContainer>> mEnderChestInventory;
397 ::ll::TypedStorage<8, 24, ::std::vector<::ActorUniqueID>> mTrackedBossIDs;
398 ::ll::TypedStorage<8, 136, ::ItemGroup> mCursorSelectedItemGroup;
399 ::ll::TypedStorage<8, 440, ::PlayerUIContainer> mPlayerUIContainer;
400 ::ll::TypedStorage<8, 48, ::InventoryTransactionManager> mTransactionManager;
401 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::GameMode>> mGameMode;
402 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::PlayerRespawnRandomizer>> mSpawnRandomizer;
403 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::SerializedSkinRef>> mSkin;
404 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ItemStackNetManagerBase>> mItemStackNetManager;
405 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::AnimationComponent>> mUIAnimationComponent;
406 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::AnimationComponent>> mMapAnimationComponent;
407 ::ll::TypedStorage<4, 28, ::Player::PlayerSpawnPoint> mPlayerRespawnPoint;
408 ::ll::TypedStorage<4, 4, float> mServerBuildRatio;
409 ::ll::TypedStorage<1, 1, ::SubClientId> mClientId;
410 ::ll::TypedStorage<1, 1, bool> mInteractDataDirty;
411 ::ll::TypedStorage<1, 1, bool> mShouldClientGenerateChunks;
412 ::ll::TypedStorage<8, 24, ::std::vector<::BiomeIdType>> mOceanBiomes;
413 ::ll::TypedStorage<1, 1, bool> mUseMapAnimationComponent;
414 ::ll::TypedStorage<1, 1, bool> mIsDeferredRenderingFirstPersonObjects;
415 ::ll::TypedStorage<1, 1, bool> mDestroyingBlock;
416 ::ll::TypedStorage<1, 1, bool> mPlayerLevelChanged;
417 ::ll::TypedStorage<4, 4, int> mPreviousLevelRequirement;
418 ::ll::TypedStorage<4, 4, int> mLastLevelUpTime;
419 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::AnimationComponent>> mFirstPersonAnimationComponent;
420 ::ll::TypedStorage<8, 24, ::std::vector<::PlayerListener*>> mListeners;
421 ::ll::TypedStorage<4, 12, ::Vec3> mRespawnPositionCandidate;
422 ::ll::TypedStorage<4, 12, ::Vec3> mPreDimensionTransferSpawnPosition;
423 ::ll::TypedStorage<4, 4, int> mEnchantmentSeed;
424 ::ll::TypedStorage<8, 24, ::std::vector<uint>> mOnScreenAnimationTextures;
425 ::ll::TypedStorage<4, 4, int> mOnScreenAnimationTicks;
426 ::ll::TypedStorage<4, 4, uint> mChunkRadius;
427 ::ll::TypedStorage<4, 4, int> mMapIndex;
428 ::ll::TypedStorage<4, 4, float> mElytraVolume;
429 ::ll::TypedStorage<8, 8, uint64> mElytraLoop;
430 ::ll::TypedStorage<8, 8, int64> mStartedBlockingTimeStamp;
431 ::ll::TypedStorage<8, 8, int64> mBlockedUsingShieldTimeStamp;
432 ::ll::TypedStorage<8, 8, int64> mBlockedUsingDamagedShieldTimeStamp;
433 ::ll::TypedStorage<8, 32, ::std::string> mName;
434 ::ll::TypedStorage<8, 40, ::std::optional<::std::string>> mChatNamePrefix;
435 ::ll::TypedStorage<8, 40, ::std::optional<::std::string>> mChatNameSuffix;
436 ::ll::TypedStorage<8, 40, ::std::optional<::std::string>> mChatMessagePrefix;
437 ::ll::TypedStorage<8, 32, ::std::string> mLastEmotePlayed;
438 ::ll::TypedStorage<8, 8, int64> mEmoteEasterEggEndTime;
439 ::ll::TypedStorage<4, 4, uint> mEmoteMessageCount;
440 ::ll::TypedStorage<8, 32, ::std::string> mDeviceId;
441 ::ll::TypedStorage<1, 1, bool> mFlagClientForBAIReset;
442 ::ll::TypedStorage<1, 1, uchar> mSendPlayerOptionsFlags;
443 ::ll::TypedStorage<1, 1, bool> mIsHostingPlayer;
444 ::ll::TypedStorage<1, 1, bool> mPrevBlockedUsingShield;
445 ::ll::TypedStorage<1, 1, bool> mPrevBlockedUsingDamagedShield;
446 ::ll::TypedStorage<1, 1, bool> mUsedPotion;
447 ::ll::TypedStorage<8, 8, ::PlayerDestroyProgressCacheComponent&> mDestroyProgressCache;
448 // NOLINTEND
449
450public:
451 // prevent constructor by default
452 Player& operator=(Player const&);
453 Player(Player const&);
454 Player();
455
456public:
457 // virtual functions
458 // NOLINTBEGIN
459 virtual ~Player() /*override*/;
460
461 virtual void
462 initializeComponents(::ActorInitializationMethod method, ::VariantParameterList const& params) /*override*/;
463
464 virtual void reloadHardcoded(::ActorInitializationMethod method, ::VariantParameterList const& params) /*override*/;
465
466 virtual void prepareRegion(::ChunkSource& mainChunkSource);
467
468 virtual void destroyRegion();
469
470 virtual void suspendRegion();
471
472 virtual void _fireDimensionChanged();
473
474 virtual bool canChangeDimensionsUsingPortal() const /*override*/;
475
476 virtual void changeDimensionWithCredits(::DimensionType dimension);
477
478#ifdef LL_PLAT_S
479 virtual void tickWorld(::Tick const&);
480#else // LL_PLAT_C
481 virtual void tickWorld(::Tick const& currentTick);
482#endif
483
484 virtual void frameUpdate(::FrameUpdateContextBase& frameUpdateContextBase) = 0;
485
486 virtual ::std::vector<::ChunkPos> const& getTickingOffsets() const;
487
488 virtual void normalTick() /*override*/;
489
490 virtual void moveView();
491
492 virtual void moveSpawnView(::Vec3 const& spawnPosition, ::DimensionType dimensionType);
493
494 virtual void onSynchedDataUpdate(int dataId) /*override*/;
495
496 virtual void aiStep() /*override*/;
497
498 virtual bool isFireImmune() const /*override*/;
499
500 virtual void checkMovementStats(::Vec3 const& d);
501
502 virtual ::HashedString getCurrentStructureFeature() const;
503
504 virtual bool isAutoJumpEnabled() const;
505
506 virtual ::Vec3 getInterpolatedRidingOffset(float, int const) const /*override*/;
507
508 virtual void passengerTick() /*override*/;
509
510 virtual void die(::ActorDamageSource const& source) /*override*/;
511
512 virtual void remove() /*override*/;
513
514 virtual void respawn();
515
516 virtual bool shouldDropDeathLoot() const /*override*/;
517
518 virtual void dropEquipmentOnDeath(::ActorDamageSource const& source) /*override*/;
519
520 virtual void dropEquipmentOnDeath() /*override*/;
521
522 virtual void clearVanishEnchantedItemsOnDeath() /*override*/;
523
524 virtual bool drop(::ItemStack const& item, bool const randomly) /*override*/;
525
526 virtual void resetRot();
527
528 virtual void resetUserPos(::ActorResetRule resetRule) /*override*/;
529
530 virtual bool isInTrialMode();
531
532 virtual void setSpeed(float _speed) /*override*/;
533
534 virtual int getItemUseDuration() const /*override*/;
535
536 virtual float getItemUseStartupProgress() const /*override*/;
537
538 virtual float getItemUseIntervalProgress() const /*override*/;
539
540 virtual bool isBlocking() const /*override*/;
541
542 virtual bool isDamageBlocked(::ActorDamageSource const& source) const /*override*/;
543
544 virtual void handleEntityEvent(::ActorEvent id, int data) /*override*/;
545
546 virtual ::std::vector<::ItemStack const*> getAllHandEquipment() const /*override*/;
547
548 virtual ::std::vector<::ItemStack const*> getAllEquipment() const /*override*/;
549
550 virtual bool add(::ItemStack& item) /*override*/;
551
552 virtual ::CommandPermissionLevel getCommandPermissionLevel() const /*override*/;
553
554 virtual ::ActorHurtResult attack(::Actor& actor, ::SharedTypes::Legacy::ActorDamageCause const& cause) /*override*/;
555
556 virtual ::ItemStack const& getCarriedItem() const /*override*/;
557
558 virtual void setCarriedItem(::ItemStack const& item) /*override*/;
559
560 virtual void damageCarriedItemOnAttack(::Actor& target, float damageDealtToTarget) /*override*/;
561
562 virtual void openPortfolio();
563
564#ifdef LL_PLAT_S
565 virtual void openBook(int, bool, int, ::BlockActor*);
566#else // LL_PLAT_C
567 virtual void openBook(int bookSlot, bool editable, int page, ::BlockActor* lectern);
568#endif
569
570 virtual void openTrading(::ActorUniqueID const& uniqueID, bool useNewScreen);
571
572#ifdef LL_PLAT_S
573 virtual void openChalkboard(::ChalkboardBlockActor&, bool);
574#else // LL_PLAT_C
575 virtual void openChalkboard(::ChalkboardBlockActor& chalkboard, bool showLockToggle);
576#endif
577
578 virtual void openNpcInteractScreen(::std::shared_ptr<::INpcDialogueData> npc);
579
580 virtual void openInventory();
581
582 virtual void displayChatMessage(
583 ::std::string const& author,
584 ::std::string const& message,
585 ::std::optional<::std::string> const filteredMessage
586 );
587
588 virtual void
589 displayClientMessage(::std::string const& message, ::std::optional<::std::string> const filteredMessage);
590
591 virtual void displayTextObjectMessage(
592 ::TextObjectRoot const& textObject,
593 ::std::string const& fromXuid,
594 ::std::string const& fromPlatformId
595 );
596
597 virtual void displayTextObjectWhisperMessage(
598 ::ResolvedTextObject const& resolvedTextObject,
599 ::std::string const& xuid,
600 ::std::string const& platformId
601 );
602
603 virtual void displayTextObjectWhisperMessage(
604 ::std::string const& message,
605 ::std::string const& xuid,
606 ::std::string const& platformId
607 );
608
609 virtual void displayWhisperMessage(
610 ::std::string const& author,
611 ::std::string const& message,
612 ::std::optional<::std::string> const filteredMessage,
613 ::std::string const& xuid,
614 ::std::string const& platformId
615 );
616
617 virtual float getShadowRadius() const /*override*/;
618
619 virtual bool isSleeping() const /*override*/;
620
621 virtual void setSleeping(bool val) /*override*/;
622
623 virtual ::BedSleepingResult startSleepInBed(::BlockPos const& bedPos, bool setsRespawn, float sleepOffset);
624
625 virtual void stopSleepInBed(bool forcefulWakeUp, bool updateLevelList);
626
627 virtual bool canStartSleepInBed();
628
629 virtual void sendInventory(bool shouldSelectSlot) /*override*/;
630
631 virtual void openSign(::BlockPos const& position, bool isFrontSide);
632
633#ifdef LL_PLAT_S
634 virtual void playEmote(::std::string const&, bool const);
635#else // LL_PLAT_C
636 virtual void playEmote(::std::string const& pieceId, bool const playChatMessage);
637#endif
638
639 virtual bool isSilentObserver() const /*override*/;
640
641 virtual void useItem(::ItemStackBase& instance, ::ItemUseMethod itemUseMethod, bool consumeItem) /*override*/;
642
643 virtual bool isLoading() const;
644
645 virtual bool isPlayerInitialized() const;
646
647 virtual void stopLoading();
648
649 virtual float getSpeed() const /*override*/;
650
651 virtual void setPlayerGameType(::GameType gameType);
652
653 virtual void initHUDContainerManager();
654
655 virtual void emitCriticalHitParticles(::Actor const& target, int particleCount);
656
657 virtual bool isImmobile() const /*override*/;
658
659 virtual void sendMotionPacketIfNeeded() /*override*/;
660
661 virtual ::IMinecraftEventing* getEventing() const;
662
663 virtual uint getUserId() const;
664
665 virtual void addExperience(int xp);
666
667 virtual void addLevels(int levels);
668
669 virtual void setArmor(::SharedTypes::Legacy::ArmorSlot slot, ::ItemStack const& item) /*override*/;
670
671 virtual void setOffhandSlot(::ItemStack const& item) /*override*/;
672
673 virtual ::std::unique_ptr<::Packet> tryCreateAddActorPacket() /*override*/;
674
675 virtual bool isInvulnerableTo(::ActorDamageSource const& source) const /*override*/;
676
677 virtual void setContainerData(::IContainerManager& menu, int id, int value) = 0;
678
679 virtual void slotChanged(
680 ::IContainerManager& menu,
681 ::Container& container,
682 int slot,
683 ::ItemStack const& oldItem,
684 ::ItemStack const& newItem,
685 bool isResultSlot
686 ) = 0;
687
688 virtual void refreshContainer(::IContainerManager& menu) = 0;
689
690 virtual void deleteContainerManager();
691
692 virtual ::ItemStack const& getEquippedTotem() const /*override*/;
693
694 virtual bool consumeTotem() /*override*/;
695
696 virtual bool isActorRelevant(::Actor const& actor);
697
698 virtual float getMapDecorationRotation() const /*override*/;
699
700 virtual void teleportTo(
701 ::Vec3 const& pos,
702 bool shouldStopRiding,
703 int cause,
704 int sourceEntityType,
705 bool keepVelocity
706 ) /*override*/;
707
708 virtual bool startRiding(::Actor& vehicle, bool forceRiding) /*override*/;
709
710 virtual void startSwimming() /*override*/;
711
712 virtual void stopSwimming() /*override*/;
713
714 virtual bool isTeacher() const = 0;
715
716 virtual bool isExternalCommunicationAllowed() const = 0;
717
718 virtual void onSuspension();
719
720 virtual void onLinkedSlotsChanged();
721
722 virtual bool canBePulledIntoVehicle() const /*override*/;
723
724 virtual void feed(int itemId) /*override*/;
725
726 virtual void sendInventoryTransaction(::InventoryTransaction const& transaction) const = 0;
727
728 virtual void
729 sendComplexInventoryTransaction(::std::unique_ptr<::ComplexInventoryTransaction> transaction) const = 0;
730
731 virtual void sendNetworkPacket(::Packet& packet) const;
732
733 virtual bool canExistWhenDisallowMob() const /*override*/;
734
735 virtual ::mce::Color getNameTagTextColor() const /*override*/;
736
737 virtual bool canAddPassenger(::Actor& passenger) const /*override*/;
738
739 virtual ::PlayerEventCoordinator& getPlayerEventCoordinator() = 0;
740
741 virtual bool isSimulated() const;
742
743 virtual ::std::string getXuid() const;
744
745 virtual ::std::string getPlayFabId() const;
746
747 virtual ::PlayerMovementSettings const& getMovementSettings() const;
748
749 virtual bool canInteractWithOtherEntitiesInGame() const /*override*/;
750
751 virtual bool canObstructSpawningAndBlockPlacement() const /*override*/;
752
753 virtual ::std::optional<::BlockPos> getLastDeathPos() const /*override*/;
754
755 virtual ::std::optional<::DimensionType> getLastDeathDimension() const /*override*/;
756
757 virtual bool hasDiedBefore() const /*override*/;
758
759 virtual void doEnterWaterSplashEffect() /*override*/;
760
761 virtual void doExitWaterSplashEffect() /*override*/;
762
763 virtual ::std::optional<::PlayerPartyInfo> getPartyInfo_UNTRUSTED() const;
764
765#ifdef LL_PLAT_S
766 virtual void requestMissingSubChunk(::SubChunkPos const&);
767#else // LL_PLAT_C
768 virtual void requestMissingSubChunk(::SubChunkPos const& scp);
769#endif
770
771 virtual uchar getMaxChunkBuildRadius() const;
772
773 virtual float causeFallDamageToActor(float distance, float multiplier, ::ActorDamageSource source) /*override*/;
774
775#ifdef LL_PLAT_S
776 virtual void setBehaviorCommandStatus(::std::string const&, ::BehaviorStatus);
777#else // LL_PLAT_C
778 virtual void setBehaviorCommandStatus(::std::string const& name, ::BehaviorStatus status);
779#endif
780
781#ifdef LL_PLAT_S
782 virtual void setRemotePlayerTicked(bool);
783#else // LL_PLAT_C
784 virtual void setRemotePlayerTicked(bool ticked);
785#endif
786
787 virtual ::std::unique_ptr<::ISparseContainerSetListener> createSparseContainerListener();
788
789 virtual void addChunksToQueue(::std::vector<::ChunkPos> const& chunkPostions, bool isBiomeUpdate);
790
791 virtual ::ActorHurtResult
792 _hurt(::ActorDamageSource const& source, float damage, ::HurtParameters const& hurtParameters) /*override*/;
793
794 virtual void readAdditionalSaveData(::CompoundTag const& tag, ::DataLoadHelper& dataLoadHelper) /*override*/;
795
796 virtual void addAdditionalSaveData(::CompoundTag& entityTag) const /*override*/;
797
798 virtual void onMovePlayerPacketNormal(::Vec3 const& pos, ::Vec2 const& rot, float yHeadRot);
799
800 virtual bool _shouldProvideFeedbackOnHandContainerItemSet(::HandSlot handSlot, ::ItemStack const& item) const
801 /*override*/;
802
803 virtual bool _shouldProvideFeedbackOnArmorSet(::SharedTypes::Legacy::ArmorSlot slot, ::ItemStack const& item) const
804 /*override*/;
805
806 virtual ::std::shared_ptr<::ChunkViewSource> _createChunkSource(::ChunkSource& mainChunkSource);
807
808 virtual void setAbilities(::LayeredAbilities const& newAbilities);
809
810 virtual ::AnimationComponent& getAnimationComponent() /*override*/;
811
812 virtual ::HashedString const& getActorRendererId() const /*override*/;
813
814 virtual ::Bedrock::NonOwnerPointer<::Editor::IEditorPlayer> getEditorPlayer() const = 0;
815
816 virtual void destroyEditorPlayer() = 0;
817
818 virtual void _serverInitItemStackIds() /*override*/;
819
820 virtual ::std::unique_ptr<::BodyControl> initBodyControl() /*override*/;
821 // NOLINTEND
822
823public:
824 // member functions
825 // NOLINTBEGIN
826 MCNAPI Player(
827 ::ILevel& level,
828 ::PacketSender& packetSender,
829 ::GameType playerGameType,
830 bool isHostingPlayer,
831 ::NetworkIdentifier const& owner,
832 ::SubClientId subid,
833 ::mce::UUID uuid,
834 ::std::string const& deviceId,
835 ::PlayerAuthenticationType authType,
836 ::PlayerAuthenticationInfo const& authInfo,
837 ::EntityContext& entityContext,
838 ::std::string const& platformId,
839 ::std::string const& platformOnlineId
840 );
841
842#ifdef LL_PLAT_C
843 MCNAPI bool _canChangeGameType(::GameType newGameType) const;
844#endif
845
847 ::Vec3& spawnPosition,
848 ::std::vector<::gsl::not_null<::BlockSource*>> regions,
849 bool adjustYToSolidGround,
850 bool searchUp,
851 bool positionFromSave
852 );
853
854#ifdef LL_PLAT_C
855 MCNAPI void _enterBedSleepState(::BlockPos const& bedBlockPos, float sleepOffset);
856
857 MCNAPI bool _findFallbackSpawnPosition(
858 ::Vec3& spawnPosition,
859 ::std::vector<::gsl::not_null<::BlockSource*>> regions,
860 uint const maxDistance,
861 bool const checkStoredFallback
862 );
863#endif
864
865 MCNAPI bool _isChunkSourceLoaded(::Vec3 const& spawnPosition, ::BlockSource const& region) const;
866
867 MCNAPI void _setInteractionSynchedData(::std::string text, ::ActorInteractionHandResult handResult);
868
869 MCNAPI void _setPlayerGameType(::GameType gameType);
870
871#ifdef LL_PLAT_C
872 MCNAPI ::BedSleepingResult _validateCanSleepInBed(::BlockPos const& bedBlockPos) const;
873
874 MCNAPI ::BedSleepingResult _validateSleepConditions(::BlockPos const& bedBlockPos) const;
875#endif
876
878 ::Vec3 const& pos,
879 ::BlockSource* blockSourceChunkCheck,
880 ::Vec3 const* const AABBoffset
881 ) const;
882
883 MCAPI ::ActorHurtResult attack(
884 ::Actor& actor,
885 ::SharedTypes::Legacy::ActorDamageCause const& cause,
886 ::Player::AttackParameters const& parameters
887 );
888
889 MCAPI bool canJump();
890
891 MCAPI bool canOpenContainerScreen();
892
893 MCNAPI bool canStackInOffhand(::ItemStack const& item) const;
894
895 MCAPI bool canUseAbility(::AbilitiesIndex abilityIndex) const;
896
897 MCAPI bool canUseOperatorBlocks() const;
898
899 MCAPI void causeFoodExhaustion(float exhaustionAmount);
900
901 MCNAPI bool checkBed(::BlockSource* spawnBlockSource, ::Vec3 const* const positionToCheck);
902
903 MCNAPI bool checkNeedAutoJump(float inputMoveX, float inputMoveZ);
904
905 MCNAPI bool checkSpawnBlock(::BlockSource const& region) const;
906
907 MCAPI void completeUsingItem();
908
909#ifdef LL_PLAT_C
910 MCNAPI void crackBlock(::BlockPos const& pos, uchar face);
911#endif
912
913 MCAPI void eat(::ItemStack const& instance);
914
915 MCAPI void eat(int hungerValue, float saturationModifier);
916
917 MCNAPI bool equippedArmorItemCanBeMoved(::ItemStack const& item) const;
918
919 MCAPI void fireDimensionChangedEvent(::DimensionType fromDimension, ::DimensionType toDimension);
920
921 MCFOLD ::LayeredAbilities const& getAbilities() const;
922
923 MCFOLD ::LayeredAbilities& getAbilities();
924
925 MCNAPI ::Bedrock::SmallOptional<::HandSlot, ::Bedrock::DefaultSmallOptionalTraits<::HandSlot>>
927
928 MCNAPI ::Agent* getAgentIfAllowed(bool callerCanAccessOtherAgents, ::ActorUniqueID callerAgentID) const;
929
930 MCNAPI ::SoundEventIdentifier getAttackCriticalHitSound() const;
931
932 MCNAPI ::SoundEventIdentifier getAttackHitSound() const;
933
934 MCNAPI ::SoundEventIdentifier getAttackMissSound() const;
935
936 MCNAPI ::std::string getChatDisplayName() const;
937
938 MCAPI float getDestroyProgress(::Block const& block);
939
940 MCAPI ::DimensionType getExpectedSpawnDimensionId() const;
941
942 MCAPI ::BlockPos const& getExpectedSpawnPosition() const;
943
944 MCNAPI ::std::string getInteractText() const;
945
946 MCAPI int getItemCooldownLeft(::HashedString const& category) const;
947
948 MCNAPI int getItemCooldownLeft(uint64 categoryHash) const;
949
950#ifdef LL_PLAT_C
951 MCNAPI float getItemCooldownProgress(::HashedString const& category) const;
952#endif
953
954 MCNAPI ::std::string getItemInteractText(::Item const& item) const;
955
956 MCNAPI int getMaxItemCooldownLeft() const;
957
958 MCAPI ::AABB getPickupArea() const;
959
960 MCAPI ::GameType getPlayerGameType() const;
961
962 MCAPI ::PlayerPermissionLevel getPlayerPermissionLevel() const;
963
964 MCNAPI float getSleepRotation() const;
965
966#ifdef LL_PLAT_C
967 MCNAPI void handleMovePlayerPacket(
968 ::PlayerPositionModeComponent::PositionMode mode,
969 ::Vec3 const& pos,
970 ::Vec2 const& rot,
971 float yHeadRot,
972 int cause,
973 int sourceEntityType
974 );
975#endif
976
977 MCNAPI bool hasResource(::ItemDescriptor const& resource);
978
979 MCAPI ::InteractionResult interact(::Actor& actor, ::Vec3 const& location, ::HandSlot handSlot);
980
981 MCAPI void inventoryChanged(
983 int slot,
984 ::ItemStack const& oldItem,
985 ::ItemStack const& newItem,
986 bool forceBalanced
987 );
988
989 MCNAPI bool isEditorPlayer() const;
990
991 MCAPI bool isEquipmentHidden() const;
992
993 MCAPI bool isFlying() const;
994
995 MCAPI bool isForcedRespawn() const;
996
997 MCAPI bool isItemOnCooldown(::HashedString const& category) const;
998
999#ifdef LL_PLAT_C
1000 MCNAPI bool isScoping() const;
1001#endif
1002
1004 ::SoundEventIdentifier const& soundEvent,
1005 ::Vec3 const& pos,
1006 int data,
1007 bool isGlobal
1008 );
1009
1011 ::SharedTypes::Legacy::LevelSoundEvent type,
1012 ::Vec3 const& pos,
1013 int data,
1014 bool isGlobal
1015 );
1016
1017#ifdef LL_PLAT_C
1018 MCNAPI void registerTrackedBoss(::ActorUniqueID mob);
1019#endif
1020
1021 MCAPI void releaseUsingItem();
1022
1023 MCAPI void resetPlayerLevel();
1024
1026
1027 MCNAPI void setAgent(::Agent* agent);
1028
1029#ifdef LL_PLAT_C
1030 MCNAPI void setBedRespawnPosition(::BlockPos const& bedPosition);
1031#endif
1032
1033 MCAPI void setChunkRadius(uint chunkRadius);
1034
1035 MCAPI void setCommandPermissions(::CommandPermissionLevel permissions);
1036
1037 MCAPI void setContainerManagerModel(::std::shared_ptr<::ContainerManagerModel> manager);
1038
1039 MCAPI void setName(::std::string const& newName);
1040
1041 MCAPI void setPlayerUIItem(::PlayerUISlot slot, ::ItemStack const& item, bool forceBalance);
1042
1043 MCAPI void setRespawnPosition(::BlockPos const& inRespawnPosition, ::DimensionType dimension);
1044
1045 MCAPI void setRespawnPositionCandidate();
1046
1047 MCAPI ::ItemStack const& setSelectedSlot(int slot);
1048
1049 MCNAPI bool setSpawnBlockRespawnPosition(::BlockPos const& spawnBlockPosition, ::DimensionType dimension);
1050
1051 MCAPI void startGliding();
1052
1053 MCNAPI void startItemCooldown(::Item const& item, bool updateClient);
1054
1055 MCAPI void startItemCooldown(::HashedString const& type, int tickDuration, bool updateClient);
1056
1057 MCAPI void
1058 startItemUseOn(uchar face, ::BlockPos const& blockPos, ::BlockPos const& buildBlockPos, ::ItemStack const& item);
1059
1060 MCAPI void startUsingItem(::ItemStack const& instance, int duration, ::HandSlot handSlot);
1061
1062 MCAPI void stopGliding();
1063
1064 MCAPI void stopItemUseOn(::BlockPos const& blockPos, ::ItemStack const& item);
1065
1066 MCAPI void stopUsingItem();
1067
1068 MCAPI bool take(::Actor& actor, int, int favoredSlot);
1069
1070 MCAPI bool tryStartGliding();
1071
1072#ifdef LL_PLAT_C
1073 MCNAPI void unRegisterTrackedBoss(::ActorUniqueID mob);
1074
1075 MCAPI bool updateEmoteMessageData(::PersonaPiece const& emotePiece);
1076#endif
1077
1078 MCAPI void updateInventoryTransactions();
1079
1080 MCAPI void updateSkin(::SerializedSkinRef const& skin, int clientSubID);
1081
1082 MCNAPI void updateTouch();
1083
1084 MCNAPI void useItemInHandSlot(::HandSlot handSlot, ::ItemUseMethod itemUseMethod, bool consumeItem);
1085 // NOLINTEND
1086
1087public:
1088 // static functions
1089 // NOLINTBEGIN
1090 MCNAPI static bool checkNeedAutoJump(
1091 ::IConstBlockSource const& region,
1092 ::AABBShapeComponent const& aabbShape,
1093 ::ActorRotationComponent const& actorRotation,
1094 float movementSpeed,
1095 ::StateVectorComponent const& stateVector,
1097 float inputMoveX,
1098 float inputMoveZ
1099 );
1100
1101 MCNAPI static ::std::optional<::SharedTypes::Legacy::LevelSoundEvent>
1102 getCustomHurtSound(::Mob const& mob, ::SharedTypes::Legacy::ActorDamageCause cause);
1103
1104#ifdef LL_PLAT_C
1105 MCNAPI static void
1106 updatePlayerGameTypeEntityData(::EntityContext& entity, ::GameType gameType, ::GameType defaultGameType);
1107#endif
1108 // NOLINTEND
1109
1110public:
1111 // static variables
1112 // NOLINTBEGIN
1113 MCAPI static ::Attribute const& EXHAUSTION();
1114
1115 MCAPI static ::Attribute const& EXPERIENCE();
1116
1117 MCAPI static ::Attribute const& HUNGER();
1118
1119 MCAPI static ::Attribute const& LEVEL();
1120
1121 MCAPI static ::Attribute const& SATURATION();
1122 // NOLINTEND
1123
1124public:
1125 // constructor thunks
1126 // NOLINTBEGIN
1127 MCNAPI void* $ctor(
1128 ::ILevel& level,
1129 ::PacketSender& packetSender,
1130 ::GameType playerGameType,
1131 bool isHostingPlayer,
1132 ::NetworkIdentifier const& owner,
1133 ::SubClientId subid,
1134 ::mce::UUID uuid,
1135 ::std::string const& deviceId,
1136 ::PlayerAuthenticationType authType,
1137 ::PlayerAuthenticationInfo const& authInfo,
1138 ::EntityContext& entityContext,
1139 ::std::string const& platformId,
1140 ::std::string const& platformOnlineId
1141 );
1142 // NOLINTEND
1143
1144public:
1145 // destructor thunk
1146 // NOLINTBEGIN
1147 MCAPI void $dtor();
1148 // NOLINTEND
1149
1150public:
1151 // virtual function thunks
1152 // NOLINTBEGIN
1153 MCNAPI void $initializeComponents(::ActorInitializationMethod method, ::VariantParameterList const& params);
1154
1155 MCNAPI void $reloadHardcoded(::ActorInitializationMethod method, ::VariantParameterList const& params);
1156
1157 MCNAPI void $prepareRegion(::ChunkSource& mainChunkSource);
1158
1159 MCNAPI void $destroyRegion();
1160
1161 MCNAPI void $suspendRegion();
1162
1164
1166
1168
1169#ifdef LL_PLAT_S
1170 MCAPI void $tickWorld(::Tick const&);
1171#else // LL_PLAT_C
1172 MCAPI void $tickWorld(::Tick const& currentTick);
1173#endif
1174
1175 MCNAPI ::std::vector<::ChunkPos> const& $getTickingOffsets() const;
1176
1177 MCAPI void $normalTick();
1178
1179 MCNAPI void $moveView();
1180
1181 MCNAPI void $moveSpawnView(::Vec3 const& spawnPosition, ::DimensionType dimensionType);
1182
1183 MCNAPI void $onSynchedDataUpdate(int dataId);
1184
1185 MCNAPI void $aiStep();
1186
1187 MCNAPI bool $isFireImmune() const;
1188
1189 MCNAPI void $checkMovementStats(::Vec3 const& d);
1190
1191 MCNAPI ::HashedString $getCurrentStructureFeature() const;
1192
1193 MCNAPI bool $isAutoJumpEnabled() const;
1194
1195 MCNAPI ::Vec3 $getInterpolatedRidingOffset(float, int const) const;
1196
1197 MCNAPI void $passengerTick();
1198
1199 MCAPI void $die(::ActorDamageSource const& source);
1200
1201 MCAPI void $remove();
1202
1203 MCAPI void $respawn();
1204
1205 MCAPI bool $shouldDropDeathLoot() const;
1206
1207 MCNAPI void $dropEquipmentOnDeath(::ActorDamageSource const& source);
1208
1210
1212
1213 MCAPI bool $drop(::ItemStack const& item, bool const randomly);
1214
1215 MCNAPI void $resetRot();
1216
1217 MCNAPI void $resetUserPos(::ActorResetRule resetRule);
1218
1219 MCNAPI bool $isInTrialMode();
1220
1221 MCNAPI void $setSpeed(float _speed);
1222
1223 MCNAPI int $getItemUseDuration() const;
1224
1225 MCNAPI float $getItemUseStartupProgress() const;
1226
1227 MCNAPI float $getItemUseIntervalProgress() const;
1228
1229 MCNAPI bool $isBlocking() const;
1230
1231 MCAPI bool $isDamageBlocked(::ActorDamageSource const& source) const;
1232
1233 MCNAPI void $handleEntityEvent(::ActorEvent id, int data);
1234
1235 MCNAPI ::std::vector<::ItemStack const*> $getAllHandEquipment() const;
1236
1237 MCNAPI ::std::vector<::ItemStack const*> $getAllEquipment() const;
1238
1239 MCAPI bool $add(::ItemStack& item);
1240
1241 MCNAPI ::CommandPermissionLevel $getCommandPermissionLevel() const;
1242
1243 MCAPI ::ActorHurtResult $attack(::Actor& actor, ::SharedTypes::Legacy::ActorDamageCause const& cause);
1244
1245 MCNAPI ::ItemStack const& $getCarriedItem() const;
1246
1247 MCNAPI void $setCarriedItem(::ItemStack const& item);
1248
1249 MCNAPI void $damageCarriedItemOnAttack(::Actor& target, float damageDealtToTarget);
1250
1251 MCNAPI void $openPortfolio();
1252
1253#ifdef LL_PLAT_S
1254 MCNAPI void $openBook(int, bool, int, ::BlockActor*);
1255#else // LL_PLAT_C
1256 MCNAPI void $openBook(int bookSlot, bool editable, int page, ::BlockActor* lectern);
1257#endif
1258
1259 MCNAPI void $openTrading(::ActorUniqueID const& uniqueID, bool useNewScreen);
1260
1261#ifdef LL_PLAT_S
1262 MCNAPI void $openChalkboard(::ChalkboardBlockActor&, bool);
1263#else // LL_PLAT_C
1264 MCNAPI void $openChalkboard(::ChalkboardBlockActor& chalkboard, bool showLockToggle);
1265#endif
1266
1267 MCNAPI void $openNpcInteractScreen(::std::shared_ptr<::INpcDialogueData> npc);
1268
1269 MCNAPI void $openInventory();
1270
1272 ::std::string const& author,
1273 ::std::string const& message,
1274 ::std::optional<::std::string> const filteredMessage
1275 );
1276
1277 MCNAPI void
1278 $displayClientMessage(::std::string const& message, ::std::optional<::std::string> const filteredMessage);
1279
1281 ::TextObjectRoot const& textObject,
1282 ::std::string const& fromXuid,
1283 ::std::string const& fromPlatformId
1284 );
1285
1287 ::ResolvedTextObject const& resolvedTextObject,
1288 ::std::string const& xuid,
1289 ::std::string const& platformId
1290 );
1291
1293 ::std::string const& message,
1294 ::std::string const& xuid,
1295 ::std::string const& platformId
1296 );
1297
1299 ::std::string const& author,
1300 ::std::string const& message,
1301 ::std::optional<::std::string> const filteredMessage,
1302 ::std::string const& xuid,
1303 ::std::string const& platformId
1304 );
1305
1306 MCNAPI float $getShadowRadius() const;
1307
1308 MCAPI bool $isSleeping() const;
1309
1310 MCNAPI void $setSleeping(bool val);
1311
1312 MCAPI ::BedSleepingResult $startSleepInBed(::BlockPos const& bedPos, bool setsRespawn, float sleepOffset);
1313
1314 MCAPI void $stopSleepInBed(bool forcefulWakeUp, bool updateLevelList);
1315
1316 MCAPI bool $canStartSleepInBed();
1317
1318 MCNAPI void $sendInventory(bool shouldSelectSlot);
1319
1320 MCNAPI void $openSign(::BlockPos const& position, bool isFrontSide);
1321
1322#ifdef LL_PLAT_S
1323 MCNAPI void $playEmote(::std::string const&, bool const);
1324#else // LL_PLAT_C
1325 MCNAPI void $playEmote(::std::string const& pieceId, bool const playChatMessage);
1326#endif
1327
1328 MCNAPI bool $isSilentObserver() const;
1329
1330 MCAPI void $useItem(::ItemStackBase& instance, ::ItemUseMethod itemUseMethod, bool consumeItem);
1331
1332 MCNAPI bool $isLoading() const;
1333
1334 MCNAPI bool $isPlayerInitialized() const;
1335
1336 MCNAPI void $stopLoading();
1337
1338 MCNAPI float $getSpeed() const;
1339
1340 MCAPI void $setPlayerGameType(::GameType gameType);
1341
1343
1344 MCNAPI void $emitCriticalHitParticles(::Actor const& target, int particleCount);
1345
1346 MCAPI bool $isImmobile() const;
1347
1349
1350 MCNAPI ::IMinecraftEventing* $getEventing() const;
1351
1352 MCNAPI uint $getUserId() const;
1353
1354 MCAPI void $addExperience(int xp);
1355
1356 MCAPI void $addLevels(int levels);
1357
1358 MCAPI void $setArmor(::SharedTypes::Legacy::ArmorSlot slot, ::ItemStack const& item);
1359
1360 MCAPI void $setOffhandSlot(::ItemStack const& item);
1361
1362 MCAPI ::std::unique_ptr<::Packet> $tryCreateAddActorPacket();
1363
1364 MCNAPI bool $isInvulnerableTo(::ActorDamageSource const& source) const;
1365
1367
1368 MCNAPI ::ItemStack const& $getEquippedTotem() const;
1369
1370 MCAPI bool $consumeTotem();
1371
1372 MCNAPI bool $isActorRelevant(::Actor const& actor);
1373
1374 MCNAPI float $getMapDecorationRotation() const;
1375
1376 MCAPI void
1377 $teleportTo(::Vec3 const& pos, bool shouldStopRiding, int cause, int sourceEntityType, bool keepVelocity);
1378
1379 MCAPI bool $startRiding(::Actor& vehicle, bool forceRiding);
1380
1381 MCNAPI void $startSwimming();
1382
1383 MCNAPI void $stopSwimming();
1384
1385 MCNAPI void $onSuspension();
1386
1388
1389 MCNAPI bool $canBePulledIntoVehicle() const;
1390
1391 MCNAPI void $feed(int itemId);
1392
1393 MCNAPI void $sendNetworkPacket(::Packet& packet) const;
1394
1395 MCNAPI bool $canExistWhenDisallowMob() const;
1396
1397 MCNAPI ::mce::Color $getNameTagTextColor() const;
1398
1399 MCAPI bool $canAddPassenger(::Actor& passenger) const;
1400
1401 MCNAPI bool $isSimulated() const;
1402
1403 MCAPI ::std::string $getXuid() const;
1404
1405 MCNAPI ::std::string $getPlayFabId() const;
1406
1407 MCNAPI ::PlayerMovementSettings const& $getMovementSettings() const;
1408
1410
1412
1413 MCNAPI ::std::optional<::BlockPos> $getLastDeathPos() const;
1414
1415 MCNAPI ::std::optional<::DimensionType> $getLastDeathDimension() const;
1416
1417 MCNAPI bool $hasDiedBefore() const;
1418
1420
1422
1423 MCNAPI ::std::optional<::PlayerPartyInfo> $getPartyInfo_UNTRUSTED() const;
1424
1425#ifdef LL_PLAT_S
1426 MCNAPI void $requestMissingSubChunk(::SubChunkPos const&);
1427#else // LL_PLAT_C
1429#endif
1430
1431 MCNAPI uchar $getMaxChunkBuildRadius() const;
1432
1433 MCAPI float $causeFallDamageToActor(float distance, float multiplier, ::ActorDamageSource source);
1434
1435#ifdef LL_PLAT_S
1436 MCNAPI void $setBehaviorCommandStatus(::std::string const&, ::BehaviorStatus);
1437#else // LL_PLAT_C
1438 MCNAPI void $setBehaviorCommandStatus(::std::string const& name, ::BehaviorStatus status);
1439#endif
1440
1441#ifdef LL_PLAT_S
1442 MCNAPI void $setRemotePlayerTicked(bool);
1443#else // LL_PLAT_C
1444 MCNAPI void $setRemotePlayerTicked(bool ticked);
1445#endif
1446
1447 MCNAPI ::std::unique_ptr<::ISparseContainerSetListener> $createSparseContainerListener();
1448
1449 MCNAPI void $addChunksToQueue(::std::vector<::ChunkPos> const& chunkPostions, bool isBiomeUpdate);
1450
1451 MCAPI ::ActorHurtResult
1452 $_hurt(::ActorDamageSource const& source, float damage, ::HurtParameters const& hurtParameters);
1453
1454 MCAPI void $readAdditionalSaveData(::CompoundTag const& tag, ::DataLoadHelper& dataLoadHelper);
1455
1456 MCNAPI void $addAdditionalSaveData(::CompoundTag& entityTag) const;
1457
1458 MCNAPI void $onMovePlayerPacketNormal(::Vec3 const& pos, ::Vec2 const& rot, float yHeadRot);
1459
1460 MCNAPI bool $_shouldProvideFeedbackOnHandContainerItemSet(::HandSlot handSlot, ::ItemStack const& item) const;
1461
1462 MCNAPI bool $_shouldProvideFeedbackOnArmorSet(::SharedTypes::Legacy::ArmorSlot slot, ::ItemStack const& item) const;
1463
1464 MCAPI ::std::shared_ptr<::ChunkViewSource> $_createChunkSource(::ChunkSource& mainChunkSource);
1465
1466 MCAPI void $setAbilities(::LayeredAbilities const& newAbilities);
1467
1468 MCNAPI ::AnimationComponent& $getAnimationComponent();
1469
1470 MCNAPI ::HashedString const& $getActorRendererId() const;
1471
1473
1474 MCNAPI ::std::unique_ptr<::BodyControl> $initBodyControl();
1475
1476
1477 // NOLINTEND
1478};
Definition AABB.h:18
Definition ActorDamageSource.h:18
Definition ActorHurtResult.h:5
Definition Actor.h:116
MCAPI bool $consumeTotem()
MCAPI ::std::unique_ptr<::Packet > $tryCreateAddActorPacket()
Definition Agent.h:34
Definition AnimationComponent.h:38
Definition Attribute.h:9
Definition BlockActor.h:30
Definition BlockPos.h:14
Definition BlockSource.h:72
Definition Block.h:42
Definition BodyControl.h:13
Definition ChalkboardBlockActor.h:25
Definition ChunkPos.h:13
Definition ChunkSource.h:37
Definition ChunkViewSource.h:23
Definition ComplexInventoryTransaction.h:17
Definition CompoundTag.h:18
Definition ConnectionRequest.h:26
Definition ContainerManagerModel.h:32
Definition Container.h:36
Definition DataLoadHelper.h:20
Definition IEditorPlayer.h:17
Definition EnderChestContainer.h:15
Definition EntityContext.h:15
Definition FrameUpdateContextBase.h:5
Definition GameMode.h:26
Definition GetCollisionShapeInterface.h:13
Definition HashedString.h:5
Definition HudContainerManagerModel.h:18
Definition IConstBlockSource.h:25
Definition IContainerManager.h:16
Definition ILevel.h:223
Definition IMinecraftEventing.h:152
Definition ISparseContainerSetListener.h:11
Definition InteractionResult.h:5
Definition InventoryTransaction.h:17
Definition Inventory.h:13
Definition ItemDescriptor.h:24
Definition ItemStackBase.h:45
Definition ItemStackNetManagerBase.h:28
Definition ItemStack.h:26
Definition Item.h:73
Definition LayeredAbilities.h:20
Definition LegacyTelemetryEventPacket.h:19
MCAPI bool $isSleeping() const
MCAPI bool $isImmobile() const
MCAPI bool $shouldDropDeathLoot() const
MCAPI void $dtor()
Definition NetworkChunkPublisher.h:27
Definition NetworkIdentifier.h:10
Definition PacketSender.h:17
Definition Packet.h:29
Definition PersonaPiece.h:22
Definition PlayerEventCoordinator.h:20
Definition PlayerInventory.h:17
Definition PlayerListener.h:5
Definition PlayerRespawnRandomizer.h:10
MCAPI bool $canExistWhenDisallowMob() const
MCAPI void $displayClientMessage(::std::string const &message, ::std::optional<::std::string > const filteredMessage)
MCAPI void _setInteractionSynchedData(::std::string text, ::ActorInteractionHandResult handResult)
MCAPI ::std::optional<::BlockPos > $getLastDeathPos() const
MCAPI void $openSign(::BlockPos const &position, bool isFrontSide)
MCAPI ::std::unique_ptr<::BodyControl > $initBodyControl()
MCAPI::std::string $getPlayFabId() const
MCAPI void $doExitWaterSplashEffect()
MCAPI void $sendMotionPacketIfNeeded()
MCAPI bool checkSpawnBlock(::BlockSource const &region) const
MCAPI bool canStackInOffhand(::ItemStack const &item) const
MCAPI void playPredictiveSynchronizedSound(::SoundEventIdentifier const &soundEvent, ::Vec3 const &pos, int data, bool isGlobal)
MCAPI void $onLinkedSlotsChanged()
MCAPI::std::string getInteractText() const
MCAPI ::std::unique_ptr<::ISparseContainerSetListener > $createSparseContainerListener()
MCAPI void $destroyRegion()
MCAPI::ItemStack const & $getEquippedTotem() const
MCAPI bool $hasDiedBefore() const
MCAPI void $onSynchedDataUpdate(int dataId)
LLNDAPI std::string getIPAndPort() const
Get the player's IP and port.
MCAPI int $getItemUseDuration() const
MCAPI void $stopSwimming()
MCAPI bool $isInvulnerableTo(::ActorDamageSource const &source) const
MCAPI void $initializeComponents(::ActorInitializationMethod method, ::VariantParameterList const &params)
MCAPI bool $isSimulated() const
MCAPI bool $isSilentObserver() const
MCAPI bool $isAutoJumpEnabled() const
LLNDAPI std::string getLocaleCode() const
Get the name of the player's langtext.
MCAPI void $onSuspension()
MCAPI void $passengerTick()
MCAPI float getSleepRotation() const
MCAPI void $displayWhisperMessage(::std::string const &author, ::std::string const &message, ::std::optional<::std::string > const filteredMessage, ::std::string const &xuid, ::std::string const &platformId)
MCAPI::ItemStack const & $getCarriedItem() const
MCAPI::SoundEventIdentifier getAttackHitSound() const
MCAPI void playPredictiveSynchronizedSound(::SharedTypes::Legacy::LevelSoundEvent type, ::Vec3 const &pos, int data, bool isGlobal)
MCAPI void $requestMissingSubChunk(::SubChunkPos const &scp)
MCAPI bool _validateSpawnPositionAvailability(::Vec3 const &pos, ::BlockSource *blockSourceChunkCheck, ::Vec3 const *const AABBoffset) const
static MCAPI ::std::optional<::SharedTypes::Legacy::LevelSoundEvent > getCustomHurtSound(::Mob const &mob, ::SharedTypes::Legacy::ActorDamageCause cause)
MCAPI void updateTouch()
MCAPI::HashedString const & $getActorRendererId() const
MCAPI bool isEditorPlayer() const
MCAPI int getItemCooldownLeft(uint64 categoryHash) const
MCAPI void $moveView()
MCAPI uchar $getMaxChunkBuildRadius() const
MCAPI::std::string getItemInteractText(::Item const &item) const
MCAPI bool equippedArmorItemCanBeMoved(::ItemStack const &item) const
MCAPI bool $isBlocking() const
MCAPI::SoundEventIdentifier getAttackMissSound() const
MCAPI void $emitCriticalHitParticles(::Actor const &target, int particleCount)
MCAPI void $onMovePlayerPacketNormal(::Vec3 const &pos, ::Vec2 const &rot, float yHeadRot)
MCAPI void $reloadHardcoded(::ActorInitializationMethod method, ::VariantParameterList const &params)
static MCAPI bool checkNeedAutoJump(::IConstBlockSource const &region, ::AABBShapeComponent const &aabbShape, ::ActorRotationComponent const &actorRotation, float movementSpeed, ::StateVectorComponent const &stateVector, ::optional_ref<::GetCollisionShapeInterface const > collisionShapeInterface, float inputMoveX, float inputMoveZ)
MCAPI void $deleteContainerManager()
MCAPI void $prepareRegion(::ChunkSource &mainChunkSource)
MCAPI void $handleEntityEvent(::ActorEvent id, int data)
MCAPI bool hasResource(::ItemDescriptor const &resource)
MCAPI void $checkMovementStats(::Vec3 const &d)
MCAPI void setAgent(::Agent *agent)
MCAPI void $initHUDContainerManager()
MCAPI::Vec3 $getInterpolatedRidingOffset(float, int const) const
MCAPI bool _isChunkSourceLoaded(::Vec3 const &spawnPosition, ::BlockSource const &region) const
LLAPI void sendMessage(std::string_view msg) const
Send a message to player.
MCAPI void $moveSpawnView(::Vec3 const &spawnPosition, ::DimensionType dimensionType)
MCAPI ::std::vector<::ItemStack const * > $getAllHandEquipment() const
MCAPI void $aiStep()
LLAPI bool addAndRefresh(class ItemStack &item)
Give player item and refresh.
MCAPI::AnimationComponent & $getAnimationComponent()
MCAPI bool checkBed(::BlockSource *spawnBlockSource, ::Vec3 const *const positionToCheck)
MCAPI float $getItemUseStartupProgress() const
MCAPI bool $canObstructSpawningAndBlockPlacement() const
MCAPI::IMinecraftEventing * $getEventing() const
LLNDAPI mce::UUID const & getUuid() const
Get the player's uuid.
MCAPI void _setPlayerGameType(::GameType gameType)
MCAPI float $getItemUseIntervalProgress() const
MCAPI::mce::Color $getNameTagTextColor() const
MCAPI::SoundEventIdentifier getAttackCriticalHitSound() const
MCAPI bool $isLoading() const
MCAPI void $doEnterWaterSplashEffect()
MCAPI bool $canInteractWithOtherEntitiesInGame() const
MCAPI bool $isInTrialMode()
MCAPI float $getSpeed() const
MCAPI ::std::optional<::PlayerPartyInfo > $getPartyInfo_UNTRUSTED() const
MCAPI float $getMapDecorationRotation() const
MCAPI ::std::vector<::ChunkPos > const & $getTickingOffsets() const
MCAPI void $dropEquipmentOnDeath()
MCAPI void $stopLoading()
MCAPI void $displayTextObjectMessage(::TextObjectRoot const &textObject, ::std::string const &fromXuid, ::std::string const &fromPlatformId)
MCAPI void $addAdditionalSaveData(::CompoundTag &entityTag) const
MCAPI bool $_shouldProvideFeedbackOnHandContainerItemSet(::HandSlot handSlot, ::ItemStack const &item) const
MCAPI void $openNpcInteractScreen(::std::shared_ptr<::INpcDialogueData > npc)
MCAPI void $setBehaviorCommandStatus(::std::string const &name, ::BehaviorStatus status)
MCAPI::CommandPermissionLevel $getCommandPermissionLevel() const
MCAPI void $setSpeed(float _speed)
MCAPI void $setRemotePlayerTicked(bool ticked)
LLNDAPI bool isOperator() const
Determine if a player is an administrator of the server.
MCAPI void $changeDimensionWithCredits(::DimensionType dimension)
MCAPI void $sendNetworkPacket(::Packet &packet) const
MCAPI void $displayTextObjectWhisperMessage(::ResolvedTextObject const &resolvedTextObject, ::std::string const &xuid, ::std::string const &platformId)
MCAPI void $clearVanishEnchantedItemsOnDeath()
MCAPI float $getShadowRadius() const
MCAPI uint $getUserId() const
MCAPI bool checkNeedAutoJump(float inputMoveX, float inputMoveZ)
LLNDAPI std::string getRealName() const
Get the player's real in-game nickname.
MCAPI void $playEmote(::std::string const &pieceId, bool const playChatMessage)
MCAPI void $sendInventory(bool shouldSelectSlot)
MCAPI ::Bedrock::SmallOptional<::HandSlot, ::Bedrock::DefaultSmallOptionalTraits<::HandSlot > > getActiveShieldSlot() const
MCAPI bool setSpawnBlockRespawnPosition(::BlockPos const &spawnBlockPosition, ::DimensionType dimension)
MCAPI void $addChunksToQueue(::std::vector<::ChunkPos > const &chunkPostions, bool isBiomeUpdate)
MCAPI void $resetUserPos(::ActorResetRule resetRule)
MCAPI void $_fireDimensionChanged()
MCAPI void $suspendRegion()
MCAPI::Agent * getAgentIfAllowed(bool callerCanAccessOtherAgents, ::ActorUniqueID callerAgentID) const
MCAPI bool $isActorRelevant(::Actor const &actor)
MCAPI void $damageCarriedItemOnAttack(::Actor &target, float damageDealtToTarget)
MCAPI void useItemInHandSlot(::HandSlot handSlot, ::ItemUseMethod itemUseMethod, bool consumeItem)
MCAPI void $displayChatMessage(::std::string const &author, ::std::string const &message, ::std::optional<::std::string > const filteredMessage)
MCAPI int getMaxItemCooldownLeft() const
MCAPI void $feed(int itemId)
MCAPI bool $isFireImmune() const
MCAPI::PlayerMovementSettings const & $getMovementSettings() const
MCAPI void $resetRot()
MCAPI ::std::optional<::DimensionType > $getLastDeathDimension() const
MCAPI void $startSwimming()
MCAPI void $displayTextObjectWhisperMessage(::std::string const &message, ::std::string const &xuid, ::std::string const &platformId)
MCAPI ::std::vector<::ItemStack const * > $getAllEquipment() const
MCAPI void $openChalkboard(::ChalkboardBlockActor &chalkboard, bool showLockToggle)
MCAPI void sendEventPacket(::LegacyTelemetryEventPacket &packet) const
MCAPI bool _checkAndFixSpawnPosition(::Vec3 &spawnPosition, ::std::vector<::gsl::not_null<::BlockSource * > > regions, bool adjustYToSolidGround, bool searchUp, bool positionFromSave)
MCAPI void $openPortfolio()
MCAPI void $openTrading(::ActorUniqueID const &uniqueID, bool useNewScreen)
MCAPI bool $canBePulledIntoVehicle() const
MCAPI bool $isPlayerInitialized() const
MCAPI bool $_shouldProvideFeedbackOnArmorSet(::SharedTypes::Legacy::ArmorSlot slot, ::ItemStack const &item) const
LLAPI void disconnect(std::string_view reason) const
Disconnect player's client.
MCAPI::std::string getChatDisplayName() const
MCAPI void $openInventory()
MCAPI void $openBook(int bookSlot, bool editable, int page, ::BlockActor *lectern)
MCAPI void $dropEquipmentOnDeath(::ActorDamageSource const &source)
MCAPI void $setSleeping(bool val)
MCAPI void * $ctor(::ILevel &level, ::PacketSender &packetSender, ::GameType playerGameType, bool isHostingPlayer, ::NetworkIdentifier const &owner, ::SubClientId subid, ::mce::UUID uuid, ::std::string const &deviceId, ::PlayerAuthenticationType authType, ::PlayerAuthenticationInfo const &authInfo, ::EntityContext &entityContext, ::std::string const &platformId, ::std::string const &platformOnlineId)
MCAPI::HashedString $getCurrentStructureFeature() const
MCAPI void $setCarriedItem(::ItemStack const &item)
MCAPI bool $canChangeDimensionsUsingPortal() const
MCAPI void startItemCooldown(::Item const &item, bool updateClient)
MCAPI void $_serverInitItemStackIds()
Definition ResolvedTextObject.h:5
Definition SerializedSkinRef.h:26
Definition SubChunkPos.h:5
Definition TextObjectRoot.h:14
Definition UserEntityIdentifierComponent.h:17
Definition Vec2.h:5
Definition Vec3.h:10
Definition Color.h:13
Definition UUID.h:8
Definition optional_ref.h:10
STL namespace.
Definition AABBShapeComponent.h:9
Definition ActorRotationComponent.h:8
Definition ActorUniqueID.h:5
Definition BiomeIdType.h:8
Definition DimensionType.h:5
Definition HurtParameters.h:8
Definition INpcDialogueData.h:12
Definition PlayerAuthenticationInfo.h:9
Definition PlayerDestroyProgressCacheComponent.h:8
Definition PlayerMovementSettings.h:9
Definition PlayerPartyInfo.h:5
Definition Player.h:162
Definition Player.h:181
Definition Player.h:199
Definition Player.h:217
Definition SoundEventIdentifier.h:13
Definition StateVectorComponent.h:8
Definition Tick.h:5
Definition VariantParameterList.h:17