Skip to content
LeviMC
English
AutoLightDark
LeviLamina
Loading...
Searching...
No Matches
CommandUtils.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/game_refs/OwnerPtr.h"
7#include "mc/world/actor/ActorType.h"
8
9// auto generated forward declare list
10// clang-format off
11class Actor;
12class BlockActor;
13class BlockPos;
14class BlockSource;
15class CommandFilePath;
16class CommandOutput;
17class CompoundTag;
18class EntityContext;
19class FunctionEntry;
20class ItemInstance;
21class ItemStack;
22class LevelData;
23class Player;
24class Vec3;
26struct ActorUniqueID;
27namespace Bedrock::Safety { class RedactableString; }
28namespace Json { class Value; }
29class BlockPos;
30class Vec3;
31class Player;
32class Actor;
33// clang-format on
34
35namespace CommandUtils {
36// functions
37// NOLINTBEGIN
38MCNAPI ::Actor* addToLevel(::OwnerPtr<::EntityContext> entity, ::BlockSource& region);
39
40MCNAPI void addtoCSVList(::std::string& list, ::std::string const& newItem);
41
42MCNAPI void alterSpawnableEntities(
43 ::LevelData& levelData,
44 ::ActorDefinitionIdentifier const& type,
45 ::ActorDefinitionIdentifier& definition
46);
47
48MCNAPI void broadcastPlayerSpawnedMobEvent(::Actor const& entity, ::Actor& summoner);
49
50MCNAPI void clearBlockEntityContents(::BlockSource& region, ::BlockPos const& pos);
51
52MCNAPI void clearBlockEntityLootTable(::BlockSource& region, ::BlockPos const& pos);
53
54MCNAPI void convertBlockEntityTag(::CompoundTag& tag, ::BlockActor const& entity, ::BlockPos const& offset);
55
56MCNAPI ::ItemStack createItemStack(::std::string const& itemName, int amount, int data);
57
58MCNAPI ::std::vector<::ItemStack> createItemStacks(::ItemInstance const& item, int amount, int& given);
59
60MCNAPI bool createMapData(::Actor& entity, ::ItemInstance& itemInstance, ::CommandOutput& output);
61
62MCNAPI void displayLocalizableMessage(
63 bool feedbackRuleDisables,
64 ::Player& player,
65 ::std::string const& message,
66 ::std::vector<::std::string> const& params
67);
68
69MCAPI ::std::string getActorName(::Actor const& actor);
70
71MCNAPI ::std::vector<::ActorType> getInvalidCommandEntities(bool isChemistryEnabled, bool isCodeBuilderEnabled);
72
73MCNAPI bool isFunctionValid(::CommandOutput& output, ::FunctionEntry& functionEntry, ::std::string const& resolvedPath);
74
75MCNAPI void nameEntity(::Actor& actor, bool nameSet, ::Bedrock::Safety::RedactableString const& actorName);
76
77MCAPI ::Actor* spawnEntityAt(
78 ::BlockSource& region,
79 ::Vec3 const& pos,
80 ::ActorDefinitionIdentifier const& type,
81 ::ActorUniqueID& id,
82 ::Actor* summoner
83);
84
85MCNAPI ::std::string toJsonResult(::std::string const& commandName, ::Json::Value const& rawData);
86
87MCNAPI ::std::string const validatePath(::CommandOutput& output, ::CommandFilePath const& filePath);
88// NOLINTEND
89
90// static variables
91// NOLINTBEGIN
92#ifdef LL_PLAT_C
93MCNAPI ::std::vector<::std::pair<::std::string, char>> const& CMD_INPUT_UNICODE_TRANSLATE_MAP();
94#endif
95// NOLINTEND
96
97} // namespace CommandUtils
Definition Actor.h:116
Definition RedactableString.h:10
Definition BlockActor.h:30
Definition BlockPos.h:14
Definition BlockSource.h:72
Definition CommandFilePath.h:5
Definition CommandOutput.h:20
Definition CompoundTag.h:18
Definition EntityContext.h:15
Definition FunctionEntry.h:16
Definition ItemInstance.h:15
Definition ItemStack.h:26
Definition Value.h:16
Definition LevelData.h:57
Definition Player.h:131
Definition Vec3.h:10
Definition ActorDefinitionIdentifier.h:15
Definition ActorUniqueID.h:5