55 create(std::string
const& name,
Vec3 const& pos,
DimensionType dimId = 0,
Vec2 const& rotation = {0, 0});
57 bool simulateSneaking() {
59 return SynchedActorDataAccess::getActorFlag(getEntityContext(), ActorFlags::Sneaking);
61 bool simulateStopSneaking() {
63 return !SynchedActorDataAccess::getActorFlag(getEntityContext(), ActorFlags::Sneaking);
65 bool simulateUseItem() {
return simulateUseItemInSlot(getSelectedItemSlot()); }
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);
91 LLAPI static ::SimulatedPlayer* tryGetFromEntity(
::EntityContext& entity,
bool includeRemoved);
96 ::ll::TypedStorage<8, 48, ::sim::MovementIntent> mSimulatedMovement;
97 ::ll::TypedStorage<1, 2, ::sim::BuildIntent> mBuildIntention;
98 ::ll::TypedStorage<8, 40, ::sim::LookAtIntent> mLookAtIntent;
99 ::ll::TypedStorage<4, 16, ::std::optional<::BlockPos>> mDestroyingBlockPos;
100 ::ll::TypedStorage<1, 2, ::std::optional<uchar>> mDestroyingBlockFace;
101 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::gametest::BaseGameTestHelper>> mGameTestHelper;
102 ::ll::TypedStorage<8, 16, ::std::optional<uint64>> mCooldownTick;
103 ::ll::TypedStorage<8, 64, ::PlayerMovementSettings> mMovementSettings;
104 ::ll::TypedStorage<4, 4, float> mBaseInputSpeed;
105 ::ll::TypedStorage<8, 32, ::std::string> mXuid;
106 ::ll::TypedStorage<8, 40, ::PlayerSuspendLevelStorageSaveToken const> mPlayerSuspendLevelStorageSaveToken;
121 virtual void aiStep() ;
124 virtual bool isSimulated()
const ;
127 virtual ::std::string getXuid()
const ;
130 virtual ::PlayerMovementSettings
const& getMovementSettings()
const ;
133 virtual void teleportTo(
135 bool shouldStopRiding,
137 int sourceEntityType,
142 virtual int _getSpawnChunkLimit()
const ;
145 virtual ::std::shared_ptr<::ChunkViewSource> _createChunkSource(
::ChunkSource& mainChunkSource) ;
148 virtual void _updateChunkPublisherView(
::Vec3 const& position,
float minDistance) ;
162 ::GameType playerGameType,
167 ::std::string
const& deviceId,
168 ::PlayerAuthenticationType authType,
171 bool enableItemStackNetManager,
175 MCAPI
void _addMoveComponent();
177 MCAPI ::ScriptModuleGameTest::ScriptNavigationResult
180 MCFOLD ::BlockSource& _getRegion();
182 MCAPI
bool _trySwing();
184 MCAPI
void _updateMovement();
186 MCAPI
void _updateRidingComponents();
188 MCAPI
void preAiStep();
192 MCAPI
bool simulateAttack();
194 MCAPI
void simulateChat(::std::string
const& message);
196 MCAPI
bool simulateInteract();
198 MCAPI
bool simulateInteract(
::BlockPos const& pos, ::ScriptModuleMinecraft::ScriptFacing face);
200 MCAPI
bool simulateJump();
202 MCAPI
void simulateLookAt(
::BlockPos const& blockPos, ::sim::LookDuration lookType = sim::LookDuration::Instant);
204 MCAPI
void simulateLookAt(
::Vec3 const& pos, ::sim::LookDuration lookType = sim::LookDuration::Instant);
206 MCAPI ::ScriptModuleGameTest::ScriptNavigationResult simulateNavigateToEntity(
::Actor& actor,
float speed);
208 MCAPI ::ScriptModuleGameTest::ScriptNavigationResult
209 simulateNavigateToLocation(
::Vec3 const& position,
float speed);
211 MCAPI
void simulateNavigateToLocations(::std::vector<::Vec3>&& positions,
float speed);
213 MCAPI
void simulateSetBodyRotation(
float degY);
215 MCAPI
void simulateStopDestroyingBlock();
217 MCAPI
bool simulateUseItemInSlot(
int slot);
219 MCAPI
bool simulateUseItemOnBlock(
222 ::ScriptModuleMinecraft::ScriptFacing face,
230 MCAPI static ::SimulatedPlayer* create(
231 ::std::string
const& name,
233 ::Vec3 const& spawnPosDelta,
234 ::Vec2 const& spawnRotation,
235 bool spawnLoadedFromSave,
237 ::Bedrock::NotNullNonOwnerPtr<::ServerNetworkHandler> serverNetworkHandler,
238 ::std::string
const& xuid,
239 ::std::optional<::ActorUniqueID> idOverride
251 ::GameType playerGameType,
256 ::std::string
const& deviceId,
257 ::PlayerAuthenticationType authType,
260 bool enableItemStackNetManager,
274 MCAPI
void $initializeComponents(::ActorInitializationMethod method,
::VariantParameterList const& params);
276 MCAPI
void $aiStep();
278 MCFOLD
bool $isSimulated()
const;
280 MCAPI ::std::string $getXuid()
const;
282 MCAPI ::PlayerMovementSettings
const& $getMovementSettings()
const;
285 $teleportTo(
::Vec3 const& pos,
bool shouldStopRiding,
int cause,
int sourceEntityType,
bool keepVelocity);
287 MCFOLD
int $_getSpawnChunkLimit()
const;
289 MCAPI ::std::shared_ptr<::ChunkViewSource> $_createChunkSource(
::ChunkSource& mainChunkSource);
291 MCFOLD
void $_updateChunkPublisherView(
::Vec3 const& position,
float minDistance);
Definition EntityContext.h:16