52 create(std::string
const& name,
Vec3 const& pos,
DimensionType dimId = 0,
Vec2 const& rotation = {0, 0});
54 [[nodiscard]]
inline bool simulateSneaking() {
56 return SynchedActorDataAccess::getActorFlag(getEntityContext(), ActorFlags::Sneaking);
58 [[nodiscard]]
inline bool simulateStopSneaking() {
60 return !SynchedActorDataAccess::getActorFlag(getEntityContext(), ActorFlags::Sneaking);
62 inline bool simulateUseItem() {
return simulateUseItemInSlot(getSelectedItemSlot()); }
64 LLAPI
bool simulateDestroyBlock(
BlockPos const&, ScriptModuleMinecraft::ScriptFacing);
66 LLAPI
bool simulateDestroyLookAt(
float handLength = 5.5f);
68 LLAPI static ::SimulatedPlayer* tryGetFromEntity(
::EntityContext& entity,
bool includeRemoved);
73 ::ll::TypedStorage<8, 48, ::sim::MovementIntent> mSimulatedMovement;
74 ::ll::TypedStorage<1, 2, ::sim::BuildIntent> mBuildIntention;
75 ::ll::TypedStorage<8, 40, ::sim::LookAtIntent> mLookAtIntent;
76 ::ll::TypedStorage<4, 16, ::std::optional<::BlockPos>> mDestroyingBlockPos;
77 ::ll::TypedStorage<1, 2, ::std::optional<uchar>> mDestroyingBlockFace;
78 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::gametest::BaseGameTestHelper>> mGameTestHelper;
79 ::ll::TypedStorage<8, 8, uint64> mCooldownTick;
80 ::ll::TypedStorage<8, 88, ::PlayerMovementSettings> mMovementSettings;
81 ::ll::TypedStorage<4, 4, float> mBaseInputSpeed;
82 ::ll::TypedStorage<8, 32, ::std::string> mXuid;
83 ::ll::TypedStorage<8, 40, ::PlayerSuspendLevelStorageSaveToken const> mPlayerSuspendLevelStorageSaveToken;
98 virtual void aiStep() ;
101 virtual bool isSimulated()
const ;
104 virtual ::std::string getXuid()
const ;
107 virtual ::PlayerMovementSettings
const& getMovementSettings()
const ;
110 virtual void teleportTo(
112 bool shouldStopRiding,
114 int sourceEntityType,
119 virtual int _getSpawnChunkLimit()
const ;
122 virtual ::std::shared_ptr<::ChunkViewSource> _createChunkSource(
::ChunkSource& mainChunkSource) ;
125 virtual void _updateChunkPublisherView(
::Vec3 const& position,
float minDistance) ;
139 ::GameType playerGameType,
144 ::std::string
const& deviceId,
147 bool enableItemStackNetManager,
151 MCAPI
void _addMoveComponent();
153 MCAPI ::ScriptModuleGameTest::ScriptNavigationResult
156 MCFOLD ::BlockSource& _getRegion();
158 MCAPI
bool _trySwing();
160 MCAPI
void _updateRidingComponents();
162 MCAPI
void preAiStep();
166 MCAPI
bool simulateAttack();
168 MCAPI
void simulateChat(::std::string
const& message);
170 MCAPI
bool simulateInteract();
172 MCAPI
bool simulateInteract(
::BlockPos const& pos, ::ScriptModuleMinecraft::ScriptFacing face);
174 MCAPI
bool simulateJump();
176 MCAPI
void simulateLocalMove(
::Vec3 const& localDirection,
float);
178 MCAPI
void simulateMoveToLocation(
::Vec3 const& position,
float speed,
bool faceTarget);
180 MCAPI ::ScriptModuleGameTest::ScriptNavigationResult simulateNavigateToEntity(
::Actor& actor,
float speed);
182 MCAPI ::ScriptModuleGameTest::ScriptNavigationResult
183 simulateNavigateToLocation(
::Vec3 const& position,
float speed);
185 MCAPI
void simulateNavigateToLocations(::std::vector<::Vec3>&& positions,
float speed);
187 MCAPI
void simulateSetBodyRotation(
float degY);
189 MCAPI
void simulateStopDestroyingBlock();
191 MCAPI
bool simulateUseItemInSlot(
int slot);
193 MCAPI
bool simulateUseItemOnBlock(
196 ::ScriptModuleMinecraft::ScriptFacing face,
200 MCAPI
void simulateWorldMove(
::Vec3 const& worldDirection,
float);
206 MCAPI static ::SimulatedPlayer* create(
207 ::std::string
const& name,
210 ::Bedrock::NotNullNonOwnerPtr<::ServerNetworkHandler> serverNetworkHandler,
211 ::std::string
const& xuid,
212 ::std::optional<::ActorUniqueID> idOverride
215 MCAPI static ::SimulatedPlayer* create(
216 ::std::string
const& name,
218 ::Vec3 const& spawnPosDelta,
219 ::Vec2 const& spawnRotation,
220 bool spawnLoadedFromSave,
222 ::Bedrock::NotNullNonOwnerPtr<::ServerNetworkHandler> serverNetworkHandler,
223 ::std::string
const& xuid,
224 ::std::optional<::ActorUniqueID> idOverride
236 ::GameType playerGameType,
241 ::std::string
const& deviceId,
244 bool enableItemStackNetManager,
258 MCAPI
void $initializeComponents(::ActorInitializationMethod method,
::VariantParameterList const& params);
260 MCAPI
void $aiStep();
262 MCFOLD
bool $isSimulated()
const;
264 MCAPI ::std::string $getXuid()
const;
266 MCAPI ::PlayerMovementSettings
const& $getMovementSettings()
const;
269 $teleportTo(
::Vec3 const& pos,
bool shouldStopRiding,
int cause,
int sourceEntityType,
bool keepVelocity);
271 MCFOLD
int $_getSpawnChunkLimit()
const;
273 MCAPI ::std::shared_ptr<::ChunkViewSource> $_createChunkSource(
::ChunkSource& mainChunkSource);
275 MCFOLD
void $_updateChunkPublisherView(
::Vec3 const& position,
float minDistance);
Definition EntityContext.h:16