53 create(std::string
const& name,
Vec3 const& pos,
DimensionType dimId = 0,
Vec2 const& rotation = {0, 0});
55 [[nodiscard]]
inline bool simulateSneaking() {
57 return SynchedActorDataAccess::getActorFlag(getEntityContext(), ActorFlags::Sneaking);
59 [[nodiscard]]
inline bool simulateStopSneaking() {
61 return !SynchedActorDataAccess::getActorFlag(getEntityContext(), ActorFlags::Sneaking);
63 inline bool simulateUseItem() {
return simulateUseItemInSlot(getSelectedItemSlot()); }
65 LLAPI
bool simulateDestroyBlock(
BlockPos const&, ScriptModuleMinecraft::ScriptFacing);
67 LLAPI
bool simulateDestroyLookAt(
float handLength = 5.5f);
69 LLAPI static ::SimulatedPlayer* tryGetFromEntity(
::EntityContext& entity,
bool includeRemoved);
74 ::ll::TypedStorage<8, 48, ::sim::MovementIntent> mSimulatedMovement;
75 ::ll::TypedStorage<1, 2, ::sim::BuildIntent> mBuildIntention;
76 ::ll::TypedStorage<8, 40, ::sim::LookAtIntent> mLookAtIntent;
77 ::ll::TypedStorage<4, 16, ::std::optional<::BlockPos>> mDestroyingBlockPos;
78 ::ll::TypedStorage<1, 2, ::std::optional<uchar>> mDestroyingBlockFace;
79 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::gametest::BaseGameTestHelper>> mGameTestHelper;
80 ::ll::TypedStorage<8, 8, uint64> mCooldownTick;
81 ::ll::TypedStorage<8, 64, ::PlayerMovementSettings> mMovementSettings;
82 ::ll::TypedStorage<4, 4, float> mBaseInputSpeed;
83 ::ll::TypedStorage<8, 32, ::std::string> mXuid;
84 ::ll::TypedStorage<8, 40, ::PlayerSuspendLevelStorageSaveToken const> mPlayerSuspendLevelStorageSaveToken;
99 virtual void aiStep() ;
102 virtual bool isSimulated()
const ;
105 virtual ::std::string getXuid()
const ;
108 virtual ::PlayerMovementSettings
const& getMovementSettings()
const ;
111 virtual void teleportTo(
113 bool shouldStopRiding,
115 int sourceEntityType,
120 virtual int _getSpawnChunkLimit()
const ;
123 virtual ::std::shared_ptr<::ChunkViewSource> _createChunkSource(
::ChunkSource& mainChunkSource) ;
126 virtual void _updateChunkPublisherView(
::Vec3 const& position,
float minDistance) ;
140 ::GameType playerGameType,
145 ::std::string
const& deviceId,
146 ::PlayerAuthenticationType authType,
149 bool enableItemStackNetManager,
153 MCAPI
void _addMoveComponent();
155 MCAPI ::ScriptModuleGameTest::ScriptNavigationResult
158 MCFOLD ::BlockSource& _getRegion();
160 MCAPI
bool _trySwing();
162 MCAPI
void _updateRidingComponents();
164 MCAPI
void preAiStep();
168 MCAPI
bool simulateAttack();
170 MCAPI
void simulateChat(::std::string
const& message);
172 MCAPI
bool simulateInteract();
174 MCAPI
bool simulateInteract(
::BlockPos const& pos, ::ScriptModuleMinecraft::ScriptFacing face);
176 MCAPI
bool simulateJump();
178 MCAPI
void simulateLocalMove(
::Vec3 const& localDirection,
float);
180 MCAPI
void simulateMoveToLocation(
::Vec3 const& position,
float speed,
bool faceTarget);
182 MCAPI ::ScriptModuleGameTest::ScriptNavigationResult simulateNavigateToEntity(
::Actor& actor,
float speed);
184 MCAPI ::ScriptModuleGameTest::ScriptNavigationResult
185 simulateNavigateToLocation(
::Vec3 const& position,
float speed);
187 MCAPI
void simulateNavigateToLocations(::std::vector<::Vec3>&& positions,
float speed);
189 MCAPI
void simulateSetBodyRotation(
float degY);
191 MCAPI
void simulateStopDestroyingBlock();
193 MCAPI
bool simulateUseItemInSlot(
int slot);
195 MCAPI
bool simulateUseItemOnBlock(
198 ::ScriptModuleMinecraft::ScriptFacing face,
202 MCAPI
void simulateWorldMove(
::Vec3 const& worldDirection,
float);
208 MCAPI static ::SimulatedPlayer* create(
209 ::std::string
const& name,
212 ::Bedrock::NotNullNonOwnerPtr<::ServerNetworkHandler> serverNetworkHandler,
213 ::std::string
const& xuid,
214 ::std::optional<::ActorUniqueID> idOverride
217 MCAPI static ::SimulatedPlayer* create(
218 ::std::string
const& name,
220 ::Vec3 const& spawnPosDelta,
221 ::Vec2 const& spawnRotation,
222 bool spawnLoadedFromSave,
224 ::Bedrock::NotNullNonOwnerPtr<::ServerNetworkHandler> serverNetworkHandler,
225 ::std::string
const& xuid,
226 ::std::optional<::ActorUniqueID> idOverride
238 ::GameType playerGameType,
243 ::std::string
const& deviceId,
244 ::PlayerAuthenticationType authType,
247 bool enableItemStackNetManager,
261 MCAPI
void $initializeComponents(::ActorInitializationMethod method,
::VariantParameterList const& params);
263 MCAPI
void $aiStep();
265 MCFOLD
bool $isSimulated()
const;
267 MCAPI ::std::string $getXuid()
const;
269 MCAPI ::PlayerMovementSettings
const& $getMovementSettings()
const;
272 $teleportTo(
::Vec3 const& pos,
bool shouldStopRiding,
int cause,
int sourceEntityType,
bool keepVelocity);
274 MCFOLD
int $_getSpawnChunkLimit()
const;
276 MCAPI ::std::shared_ptr<::ChunkViewSource> $_createChunkSource(
::ChunkSource& mainChunkSource);
278 MCFOLD
void $_updateChunkPublisherView(
::Vec3 const& position,
float minDistance);
Definition EntityContext.h:16