MCPcopy Create free account
hub / github.com/cuberite/cuberite / SetCommand

Method SetCommand

src/BlockEntities/CommandBlockEntity.cpp:42–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40
41
42void cCommandBlockEntity::SetCommand(const AString & a_Cmd)
43{
44 m_Command = a_Cmd;
45
46 /*
47 Vanilla requires that the server send a Block Entity Update after a command has been set
48 Therefore, command blocks don't support on-the-fly (when window is open) updating of a command and therefore...
49 ...the following code can't be put in UsedBy just before the window opens
50
51 Just documenting my experience in getting this to work :P
52 */
53 m_World->BroadcastBlockEntity(GetPosX(), GetPosY(), GetPosZ());
54}
55
56
57

Callers 2

ItemMethod · 0.80

Calls 1

BroadcastBlockEntityMethod · 0.45

Tested by

no test coverage detected