mojira.dev
MC-91854

Commands unable to change beacon effects

Using /blockdata or /setblock to change beacon effects to any potion effect not given by a beacon by normal means no longer works.

*Added note when using the commands of /setblock and /blockdata I had 4 layers of valid blocks for the beacon to have it give full lvl4 beacon effect range or 9x9 Emerald Block base with 7x7 Diamond layer above that 5x5 Gold block above that 3x3 Iron block above that.
*the block being targeted by the tag: "replace" was a block of iron

*Exact commands used:

/blockdata ~ ~-1 ~ {}
/blockdata ~ ~-1 ~ {Primary:x,Secondary:x}
/setblock ~ ~-1 ~ minecraft:beacon 0 replace {Primary:x,Secondary:x}

x= "2, 4, 6, 7, 9, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27" When these values are used and then after using "/blockdata ~ ~-1 ~ {}" the game states the values for tags: "Primary, Secondary" are set to "0"
x= "1,3,5,8,10,11" the commands work as should.

Linked issues

Comments 13

Provide the exact commands used

exact commands used:
/blockdata ~ ~-1 ~ {}
/blockdata ~ ~-1 ~ {Primary:x,Secondary:x}
x is for values of "2,4,6,7,9,12,13,14,15,16,17,18,19,20,21,22,23" that potion ids I tested and did not work
values of "1,3,5,8,10,11" are ids that do work
values of "24,25,26,27" I did not test

I'm not saying your description is too detailed, but a shorter description and/or a tl;dr could help this issue get more attention.

Thank you for stating that I hope this is better.

Upon trying to test porting from an older version of the game (1.8.8) with the "custom" beacons being made in that version I have taken notice that this also effects that version as well.
*I have before never tried these commands in this version as i normally played a tad older version of 1.8

3 more comments

Is Mojang really sure this is intended behaviour? I tested this in 1.9.1 pre-3 and even though you can't get potion effects like Wither, Absorption and Levitation, you can still get Regeneration 2 which is an illegitimate beacon effect in normal survival.

/setblock ~ ~ ~5 minecraft:beacon 0 replace {Primary:10,Secondary:10}

I don't see a difference between this and

/give @p minecraft:emerald 1 0 {ench:[{id:16,lvl:9000}]}

both are illegitimate in normal survival gameplay, but don't brake the game and are good tools for map makers.

Could someone at Mojang/Mod tell us why this was marked as intended?

it might be because of server security reasons, but we're unsure about this

Well, the only down side I know of when using custom beacon effects in versions like 1.7.10 is when you try to set it to an effect that doesn't exist (Like id:25 aka Levitation from 1.9). When the beacon tries to activate with that data the game just crashes due to not being able to comprehend the invalid potion effect. When I'm not so busy on the weekend I'll check the versions between 1.7.10 and 1.8.8 to see if there are any clues there.

Okay, I've done some more testing/checking today and it turns out this change was introduced in 1.8.5 which was also a security update. According to the Minecraft wiki this update fixed some bugs such as MC-80478, MC-80479 and MC-80480 all of which are private issues. MC-80479 is the interesting one: "Invalid beacon effects are not validated". My bet is this is the bug where you give the beacon a non-existent status effect like id:99 and the game crashes.

Something else I found out today was that in 1.8.5+ not only can you get a Regeneration 2 beacon, but you can get beacons that emit two status effects at level 1 as long as those status effects are Regeneration, Speed, Jump boost, Haste, Strength and Resistance (So for example a Speed 1, Strength 1 beacon isn't possible to get normally, but you can still get it with the command). Also if you are in 1.8.5+ and you try to make a beacon with an invalid effect like slowness (id:2) then the beacon takes a bit longer to activate than normal and when it does it emits nothing. Using the command

/blockdata ~ ~-1 ~ {}

when standing on top of the beacon it reveals that it has defaulted to id:0. This means there is some part of code in the beacon that checks to see if the applied status effect is Regeneration, Speed, Jump boost, Haste, Strength or Resistance and if so it allows it, if not then it changes the id to zero.

I don't know what the Minecraft code looks like or how status effects are stored, but wouldn't it be just fine to change this code so that it checks if the id is a valid potion effect rather than a beacon's status effect? Or if that can't work then maybe the beacon has all the status effects available, but you can still only select the original 6 from the GUI.

MC-80479 is indeed the reason for this. Changing beacons to allow them to emit effects other than those available through the GUI would be a feature request.

Jeffrey P Gorsuch

Erik Broes

Confirmed

command

Minecraft 1.8.8, Minecraft 15w44b, Minecraft 15w45a, Minecraft 15w46a, Minecraft 15w47b, Minecraft 15w47c

Retrieved