Cuberite Forum
How should I use cPluginManager.ExecuteConsoleCommand ??? - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Plugins (https://forum.cuberite.org/forum-1.html)
+--- Forum: Plugin Discussion (https://forum.cuberite.org/forum-8.html)
+--- Thread: How should I use cPluginManager.ExecuteConsoleCommand ??? (/thread-3339.html)



How should I use cPluginManager.ExecuteConsoleCommand ??? - mueller_minki - 02-19-2021

Hello, I was wondering if I could solve the commandblock issue by making a console command that would use cPluginManager.ExecuteConsoleCommand to simulate a command being run by a player. To test it, I made a new function which simply ran
Code:
cPluginManager.ExecuteConsoleCommand(cPluginManager, "/say Does this work?!?")
It said it had executed properly but there was no message in the chat. Why did that happen?


RE: How should I use cPluginManager.ExecuteConsoleCommand ??? - NiLSPACE - 02-19-2021

I believe console commands don't start with a /.

Also, you can if you use a colon you don't have to provide cPluginManager as an argument:

cPluginManager:ExecuteConsoleCommand("say Does this work?!?");