CommandHelper

CommandHelper

46.5k Downloads

get_command_block() always returns null

LadyCailinBot opened this issue ยท 10 comments

commented

CMDHELPER-3158 - Reported by Nolz

Using the following alias in a command block;

/test = >>>
broadcast(get_command_block())
<<<

In build #3238, this will broadcast the command blocks's coordinates in a Location Array in the server chat, as expected. But when I do the same thing using build #3241 (the latest build, as of writing), I get Trying to broadcast null won't work as error in the console. This error appears on both my private server and the public server I work for.

My guess is that this is caused by the recent changes to this function made in build #3239.

commented

Comment by PseudoKnight

Hm. I can't reproduce this. What version of MC/Spigot are you on?

commented

Comment by PseudoKnight

I tried this on 1.12.2, after the change that caused CommandBlocks to call ServerCommandEvents, and clear back to 1.7.10, the earliest version I try and support. Both worked as expected.

commented

Comment by Nolz

@PseudoKnight We're running 1.12.2 using PaperSpigot build 1228

commented

Comment by PseudoKnight

In the CommandBlock, are you using "runalias /test" or just "test". (both worked for me, but it will help me know where to look)

commented

Comment by Nolz

I've tried both, but neither worked.

commented

Comment by PseudoKnight

Welp. I can't reproduce and I'm not sure what the difference would be between our servers. Does it happen on your test server without any other plugins? If so, what are your plugins?

commented

Comment by Nolz

For whatever reason, it doesn't happen on my test server anymore. All I did was switching back to build 3241, without changing anything else.
I'll have to try redownloading commandhelper on the public server as well, and see if that does anything. It'll take a few hours before I can try that, though.

commented

Comment by PseudoKnight

Well, that's disconcerting.

The only thing I can think of that would produce these results is if you had somehow not actually updated your server to the new build and had run an alias without /runalias in front. To be clear, that didn't used to run aliases in commandblocks. That's a recent change in Bukkit, so these commits are meant to fix that and support aliases fully in commandblocks.

commented

Comment by Nolz

After clearing the cache (it was nearly a year old) and reinstalling Commandhelper on the public server, it seems that everything now works as it should.

I've got no idea why it started working. The only thing I could think of is that I did screw up somewhere when updating to a new build, but I'm not even sure how that could've happened.

I suppose we can consider this to be solved.

commented

Comment by PseudoKnight

Thanks for following up. I hope that's what it was.