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