51class SimulatedPlayer :
public ::ServerPlayer {
54 create(std::string
const& name,
Vec3 const& pos,
DimensionType dimId = 0,
Vec2 const& rotation = {0, 0});
56 bool simulateSneaking() {
58 return SynchedActorDataAccess::getActorFlag(mEntityContext, ActorFlags::Sneaking);
60 bool simulateStopSneaking() {
62 return !SynchedActorDataAccess::getActorFlag(mEntityContext, ActorFlags::Sneaking);
64 bool simulateUseItem() {
return simulateUseItemInSlot(mInventory->mSelected); }
65 LLAPI
bool simulateUseItem(
ItemStack& item);
67 LLAPI
bool simulateDestroyBlock(
BlockPos const&, ScriptModuleMinecraft::ScriptFacing);
68 LLAPI
bool simulateDestroyLookAt(
float handLength = 5.5f);
69 LLAPI
void simulateStopMoving();
70 LLAPI
bool simulateAttack(
Actor* target);
71 LLAPI
void simulateStartBuildInSlot(
int slot);
72 LLAPI
void simulateStopBuild();
73 LLAPI
void simulateStopUsingItem();
74 LLAPI
bool simulateGiveItem(
ItemStack& item,
bool selectSlot);
75 LLAPI
bool simulateSetItem(
ItemStack const& item,
bool selectSlot,
int slot);
76 LLAPI
bool simulateDropSelectedItem();
77 LLAPI
bool simulateInteract(
Actor& actor);
78 LLAPI
void simulateStopInteracting();
79 LLAPI
bool isSimulatingDestroyingBlock();
81 LLAPI
void simulateLookAt(
Actor& actor, sim::LookDuration lookType = sim::LookDuration::Instant);
83 LLAPI
void simulateDisconnect();
84 LLAPI
bool simulateRespawn();
85 LLAPI
void simulateFly();
86 LLAPI
void simulateStopFlying();
87 LLAPI
void simulateWorldMove(
::Vec3 const& worldDirection,
float = 1.0f);
88 LLAPI
void simulateLocalMove(
::Vec3 const& localDirection,
float = 1.0f);
89 LLAPI
void simulateMoveToLocation(
::Vec3 const& position,
float speed,
bool faceTarget);
90 LLAPI
void simulateStopDestroyingBlock();
91 LLAPI
bool simulateInteract(
::BlockPos const& pos, ::ScriptModuleMinecraft::ScriptFacing face);
93 LLAPI static ::SimulatedPlayer* tryGetFromEntity(
::EntityContext& entity,
bool includeRemoved);
98 ::ll::TypedStorage<8, 48, ::sim::MovementIntent> mSimulatedMovement;
99 ::ll::TypedStorage<1, 2, ::sim::BuildIntent> mBuildIntention;
100 ::ll::TypedStorage<8, 40, ::sim::LookAtIntent> mLookAtIntent;
101 ::ll::TypedStorage<4, 16, ::std::optional<::BlockPos>> mDestroyingBlockPos;
102 ::ll::TypedStorage<1, 2, ::std::optional<uchar>> mDestroyingBlockFace;
103 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::gametest::BaseGameTestHelper>> mGameTestHelper;
104 ::ll::TypedStorage<8, 16, ::std::optional<uint64>> mInputCooldownTick;
105 ::ll::TypedStorage<8, 64, ::PlayerMovementSettings> mMovementSettings;
106 ::ll::TypedStorage<4, 4, float> mBaseInputSpeed;
107 ::ll::TypedStorage<8, 32, ::std::string> mXuid;
108 ::ll::TypedStorage<8, 40, ::PlayerSuspendLevelStorageSaveToken const> mPlayerSuspendLevelStorageSaveToken;
121 virtual void aiStep() ;
123 virtual bool isSimulated()
const ;
125 virtual ::std::string getXuid()
const ;
127 virtual ::PlayerMovementSettings
const& getMovementSettings()
const ;
129 virtual void teleportTo(
131 bool shouldStopRiding,
133 int sourceEntityType,
137 virtual int _getSpawnChunkLimit()
const ;
139 virtual ::std::shared_ptr<::ChunkViewSource> _createChunkSource(
::ChunkSource& mainChunkSource) ;
141 virtual void _updateChunkPublisherView(
::Vec3 const& position,
float minDistance) ;
152 ::GameType playerGameType,
155 ::std::function<
void(::ServerPlayer&)> playerLoadedCallback,
157 ::std::string
const& deviceId,
158 ::PlayerAuthenticationType authType,
161 bool enableItemStackNetManager,
167 MCNAPI ::ScriptModuleGameTest::ScriptNavigationResult
182 MCAPI
bool simulateAttack();
184 MCAPI
void simulateChat(::std::string
const& message);
186 MCAPI
bool simulateInteract();
188 MCAPI
bool simulateJump();
190 MCAPI
void simulateLookAt(
::BlockPos const& blockPos, ::sim::LookDuration lookType);
192 MCAPI
void simulateLookAt(
::Vec3 const& pos, ::sim::LookDuration lookType = sim::LookDuration::Instant);
194 MCAPI ::ScriptModuleGameTest::ScriptNavigationResult simulateNavigateToEntity(
::Actor& actor,
float speed);
196 MCAPI ::ScriptModuleGameTest::ScriptNavigationResult
197 simulateNavigateToLocation(
::Vec3 const& position,
float speed);
199 MCAPI
void simulateNavigateToLocations(::std::vector<::Vec3>&& positions,
float speed);
201 MCAPI
void simulateSetBodyRotation(
float degY);
203 MCAPI
bool simulateUseItemInSlot(
int slot);
205 MCAPI
bool simulateUseItemInSlotOnBlock(
208 ::ScriptModuleMinecraft::ScriptFacing face,
212 MCAPI
bool simulateUseItemOnBlock(
215 ::ScriptModuleMinecraft::ScriptFacing face,
224 ::std::string
const& name,
227 ::Bedrock::NotNullNonOwnerPtr<::ServerNetworkHandler> serverNetworkHandler,
228 ::std::string
const& xuid,
229 ::std::optional<::ActorUniqueID> idOverride
232 MCAPI static ::SimulatedPlayer* create(
233 ::std::string
const& name,
235 ::Vec3 const& spawnPosDelta,
236 ::Vec2 const& spawnRotation,
237 bool spawnLoadedFromSave,
239 ::Bedrock::NotNullNonOwnerPtr<::ServerNetworkHandler> serverNetworkHandler,
240 ::std::string
const& xuid,
241 ::std::optional<::ActorUniqueID> idOverride
253 ::GameType playerGameType,
256 ::std::function<
void(::ServerPlayer&)> playerLoadedCallback,
258 ::std::string
const& deviceId,
259 ::PlayerAuthenticationType authType,
262 bool enableItemStackNetManager,
281 $teleportTo(
::Vec3 const& pos,
bool shouldStopRiding,
int cause,
int sourceEntityType,
bool keepVelocity);
285 MCAPI ::std::shared_ptr<::ChunkViewSource> $_createChunkSource(
::ChunkSource& mainChunkSource);
Definition EntityContext.h:15
MCAPI SimulatedPlayer(::Level &level, ::PacketSender &packetSender, ::ServerNetworkSystem &network, ::ClientBlobCache::Server::ActiveTransfersManager &clientCacheMirror, ::GameType playerGameType, ::NetworkIdentifier const &owner, ::SubClientId subid, ::std::function< void(::ServerPlayer &)> playerLoadedCallback, ::mce::UUID uuid, ::std::string const &deviceId, ::PlayerAuthenticationType authType, ::PlayerAuthenticationInfo const &authInfo, int maxChunkRadius, bool enableItemStackNetManager, ::EntityContext &entityContext)
MCAPI void * $ctor(::Level &level, ::PacketSender &packetSender, ::ServerNetworkSystem &network, ::ClientBlobCache::Server::ActiveTransfersManager &clientCacheMirror, ::GameType playerGameType, ::NetworkIdentifier const &owner, ::SubClientId subid, ::std::function< void(::ServerPlayer &)> playerLoadedCallback, ::mce::UUID uuid, ::std::string const &deviceId, ::PlayerAuthenticationType authType, ::PlayerAuthenticationInfo const &authInfo, int maxChunkRadius, bool enableItemStackNetManager, ::EntityContext &entityContext)