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