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