Division by zero crash with alternating /recipe commands
To reproduce
Run a
/recipe give @p *
command in quick oscillating succession with
/recipe take @p *
It will crash the game with a Divide By Zero error like the one in the attached crash
log. My sparse tests show it won't crash if there are 8 redstone ticks between the commands, but it will crash if there are only 2 redstone ticks between them. More testing can narrow down the range, I'm sure, but I don't think the exact timing is important here.
Description: Unexpected error java.lang.ArithmeticException: / by zero at bio$b.a(SourceFile:187) at bio.a(SourceFile:44) at bgu.aw(SourceFile:985) at bgu.a(SourceFile:399) at net.minecraft.client.main.Main.main(SourceFile:123)
Why?
Before anyone says "well, don't do that!", there's a legitimate reason to quickly give and take recipes like that. I was using a location-based advancement to test the biome the players are in, and only allow them to craft in certain areas of the map. To do this, I have to take all recipes every tick, check if they have the advancement, and if so, give them back their recipes and revoke the advancement. Alternately, I could only take their recipes if they haven't earned the advancement, but even then, if they cross from one biome into the next quickly enough, it will trigger the crash. And we don't want our custom maps completely crashing Minecraft for players, do we?
Linked Issues
is cloned by1
Created Issue:
Divide By Zero error with alternating /recipe commands
Setup
Run a /recipe give @p * command in quick oscillating succession with /recipe take @p *. It will crash the game with a Divide By Zero error like the one in the attached crash log.Why?
Before anyone says "well, don't do that!", there's a legitimate reason to quickly give and take recipes like that. I was using a location-based advancement to test the biome the players are in, and only allow them to craft in certain areas of the map. To do this, I have to take all recipes every tick, check if they have the advancement, and if so, give them back their recipes and revoke the advancement. Alternately, I could only take their recipes if they haven't earned the advancement, but even then, if they cross from one biome into the next quickly enough, it will trigger the crash. And we don't want our custom maps completely crashing Minecraft for players, do we?
Divide By Zeroerrorwith alternating /recipe commandsDivide By Zero crash with alternating /recipe commands
Setup
Run a /recipe give @p * command in quick oscillating succession with /recipe take @p *. It will crash the game with a Divide By Zero error like the one in the attached crash log.Why?
Before anyone says "well, don't do that!", there's a legitimate reason to quickly give and take recipes like that. I was using a location-based advancement to test the biome the players are in, and only allow them to craft in certain areas of the map. To do this, I have to take all recipes every tick, check if they have the advancement, and if so, give them back their recipes and revoke the advancement. Alternately, I could only take their recipes if they haven't earned the advancement, but even then, if they cross from one biome into the next quickly enough, it will trigger the crash. And we don't want our custom maps completely crashing Minecraft for players, do we?Setup
Run a/recipe give @p *
{/code}command in quick oscillating succession with /recipe take @p *. It will crash the game with a Divide By Zero error like the one in the attached crash log.
Why?
Before anyone says "well, don't do that!", there's a legitimate reason to quickly give and take recipes like that. I was using a location-based advancement to test the biome the players are in, and only allow them to craft in certain areas of the map. To do this, I have to take all recipes every tick, check if they have the advancement, and if so, give them back their recipes and revoke the advancement. Alternately, I could only take their recipes if they haven't earned the advancement, but even then, if they cross from one biome into the next quickly enough, it will trigger the crash. And we don't want our custom maps completely crashing Minecraft for players, do we?
Setup
Run a/recipe give @p *
{/code}command in quick oscillating succession with /recipe take @p *. It will crash the game with a Divide By Zero error like the one in the attached crash log.
Why?
Before anyone says "well, don't do that!", there's a legitimate reason to quickly give and take recipes like that. I was using a location-based advancement to test the biome the players are in, and only allow them to craft in certain areas of the map. To do this, I have to take all recipes every tick, check if they have the advancement, and if so, give them back their recipes and revoke the advancement. Alternately, I could only take their recipes if they haven't earned the advancement, but even then, if they cross from one biome into the next quickly enough, it will trigger the crash. And we don't want our custom maps completely crashing Minecraft for players, do we?Setup
Run a /recipe give @p * command in quick oscillating succession with /recipe take @p *. It will crash the game with a Divide By Zero error like the one in the attached crash log.Why?
Before anyone says "well, don't do that!", there's a legitimate reason to quickly give and take recipes like that. I was using a location-based advancement to test the biome the players are in, and only allow them to craft in certain areas of the map. To do this, I have to take all recipes every tick, check if they have the advancement, and if so, give them back their recipes and revoke the advancement. Alternately, I could only take their recipes if they haven't earned the advancement, but even then, if they cross from one biome into the next quickly enough, it will trigger the crash. And we don't want our custom maps completely crashing Minecraft for players, do we?
Setup
Run a /recipe give @p * command in quick oscillating succession with /recipe take @p *. It will crash the game with a Divide By Zero error like the one in the attached crash log.Why?
Before anyone says "well, don't do that!", there's a legitimate reason to quickly give and take recipes like that. I was using a location-based advancement to test the biome the players are in, and only allow them to craft in certain areas of the map. To do this, I have to take all recipes every tick, check if they have the advancement, and if so, give them back their recipes and revoke the advancement. Alternately, I could only take their recipes if they haven't earned the advancement, but even then, if they cross from one biome into the next quickly enough, it will trigger the crash. And we don't want our custom maps completely crashing Minecraft for players, do we?Setup
Run a/recipe give @p *command in quick oscillating succession with
/recipe take @p *. It will crash the game with a Divide By Zero error like the one in the attached crash log.
Why?
Before anyone says "well, don't do that!", there's a legitimate reason to quickly give and take recipes like that. I was using a location-based advancement to test the biome the players are in, and only allow them to craft in certain areas of the map. To do this, I have to take all recipes every tick, check if they have the advancement, and if so, give them back their recipes and revoke the advancement. Alternately, I could only take their recipes if they haven't earned the advancement, but even then, if they cross from one biome into the next quickly enough, it will trigger the crash. And we don't want our custom maps completely crashing Minecraft for players, do we?
Setup
Run a/recipe give @p *command in quick oscillating succession with
/recipe take @p *. It will crash the game with a Divide By Zero error like the one in the attached crash log.
Why?
Before anyone says "well, don't do that!", there's a legitimate reason to quickly give and take recipes like that. I was using a location-based advancement to test the biome the players are in, and only allow them to craft in certain areas of the map. To do this, I have to take all recipes every tick, check if they have the advancement, and if so, give them back their recipes and revoke the advancement. Alternately, I could only take their recipes if they haven't earned the advancement, but even then, if they cross from one biome into the next quickly enough, it will trigger the crash. And we don't want our custom maps completely crashing Minecraft for players, do we?
Setup
Run a/recipe give @p *command in quick oscillating succession with
/recipe take @p *. It will crash the game with a Divide By Zero error like the one in the attached crash log.
Why?
Before anyone says "well, don't do that!", there's a legitimate reason to quickly give and take recipes like that. I was using a location-based advancement to test the biome the players are in, and only allow them to craft in certain areas of the map. To do this, I have to take all recipes every tick, check if they have the advancement, and if so, give them back their recipes and revoke the advancement. Alternately, I could only take their recipes if they haven't earned the advancement, but even then, if they cross from one biome into the next quickly enough, it will trigger the crash. And we don't want our custom maps completely crashing Minecraft for players, do we?Setup
Run a `/recipe give @p *` command in quick oscillating succession with/recipe take @p *. It will crash the game with a Divide By Zero error like the one in the attached crash log.
Why?
Before anyone says "well, don't do that!", there's a legitimate reason to quickly give and take recipes like that. I was using a location-based advancement to test the biome the players are in, and only allow them to craft in certain areas of the map. To do this, I have to take all recipes every tick, check if they have the advancement, and if so, give them back their recipes and revoke the advancement. Alternately, I could only take their recipes if they haven't earned the advancement, but even then, if they cross from one biome into the next quickly enough, it will trigger the crash. And we don't want our custom maps completely crashing Minecraft for players, do we?
Setup
Run a `/recipe give @p *` command in quick oscillating succession with/recipe take @p *. It will crash the game with a Divide By Zero error like the one in the attached crash log.
Why?
Before anyone says "well, don't do that!", there's a legitimate reason to quickly give and take recipes like that. I was using a location-based advancement to test the biome the players are in, and only allow them to craft in certain areas of the map. To do this, I have to take all recipes every tick, check if they have the advancement, and if so, give them back their recipes and revoke the advancement. Alternately, I could only take their recipes if they haven't earned the advancement, but even then, if they cross from one biome into the next quickly enough, it will trigger the crash. And we don't want our custom maps completely crashing Minecraft for players, do we?Setup
Run a/recipe give @p *`command in quick oscillating succession with
/recipe take @p *. It will crash the game with a Divide By Zero error like the one in the attached crash log.
Why?
Before anyone says "well, don't do that!", there's a legitimate reason to quickly give and take recipes like that. I was using a location-based advancement to test the biome the players are in, and only allow them to craft in certain areas of the map. To do this, I have to take all recipes every tick, check if they have the advancement, and if so, give them back their recipes and revoke the advancement. Alternately, I could only take their recipes if they haven't earned the advancement, but even then, if they cross from one biome into the next quickly enough, it will trigger the crash. And we don't want our custom maps completely crashing Minecraft for players, do we?
Setup
Run a/recipe give @p *`command in quick oscillating succession with
/recipe take @p *. It will crash the game with a Divide By Zero error like the one in the attached crash log.
Why?
Before anyone says "well, don't do that!", there's a legitimate reason to quickly give and take recipes like that. I was using a location-based advancement to test the biome the players are in, and only allow them to craft in certain areas of the map. To do this, I have to take all recipes every tick, check if they have the advancement, and if so, give them back their recipes and revoke the advancement. Alternately, I could only take their recipes if they haven't earned the advancement, but even then, if they cross from one biome into the next quickly enough, it will trigger the crash. And we don't want our custom maps completely crashing Minecraft for players, do we?
Setup
Run a/recipe give @p *command in quick oscillating succession with
/recipe take @p *. It will crash the game with a Divide By Zero error like the one in the attached crash log.
Why?
Before anyone says "well, don't do that!", there's a legitimate reason to quickly give and take recipes like that. I was using a location-based advancement to test the biome the players are in, and only allow them to craft in certain areas of the map. To do this, I have to take all recipes every tick, check if they have the advancement, and if so, give them back their recipes and revoke the advancement. Alternately, I could only take their recipes if they haven't earned the advancement, but even then, if they cross from one biome into the next quickly enough, it will trigger the crash. And we don't want our custom maps completely crashing Minecraft for players, do we?Setup
Run a/recipe give @p *command in quick oscillating succession with
/recipe take @p *. It will crash the game with a Divide By Zero error like the one in the attached crash log. My sparse tests show it won't crash if there are 8 redstone ticks between the commands, but it will crash if there are only 2 redstone ticks between them. More testing can narrow down the range, I'm sure, but I don't think the exact timing is important here.
Why?
Before anyone says "well, don't do that!", there's a legitimate reason to quickly give and take recipes like that. I was using a location-based advancement to test the biome the players are in, and only allow them to craft in certain areas of the map. To do this, I have to take all recipes every tick, check if they have the advancement, and if so, give them back their recipes and revoke the advancement. Alternately, I could only take their recipes if they haven't earned the advancement, but even then, if they cross from one biome into the next quickly enough, it will trigger the crash. And we don't want our custom maps completely crashing Minecraft for players, do we?
Setup
Run a/recipe give @p *command in quick oscillating succession with
/recipe take @p *
.It will crash the game with a Divide By Zero error like the one in the attached crash log. My sparse tests show it won't crash if there are 8 redstone ticks between the commands, but it will crash if there are only 2 redstone ticks between them. More testing can narrow down the range, I'm sure, but I don't think the exact timing is important here.Why?
Before anyone says "well, don't do that!", there's a legitimate reason to quickly give and take recipes like that. I was using a location-based advancement to test the biome the players are in, and only allow them to craft in certain areas of the map. To do this, I have to take all recipes every tick, check if they have the advancement, and if so, give them back their recipes and revoke the advancement. Alternately, I could only take their recipes if they haven't earned the advancement, but even then, if they cross from one biome into the next quickly enough, it will trigger the crash. And we don't want our custom maps completely crashing Minecraft for players, do we?To reproduce
Run a
/recipe give @p *command in quick oscillating succession with
/recipe take @p *It will crash the game with a Divide By Zero error like the one in the attached crash log. My sparse tests show it won't crash if there are 8 redstone ticks between the commands, but it will crash if there are only 2 redstone ticks between them. More testing can narrow down the range, I'm sure, but I don't think the exact timing is important here.
Why?
Before anyone says "well, don't do that!", there's a legitimate reason to quickly give and take recipes like that. I was using a location-based advancement to test the biome the players are in, and only allow them to craft in certain areas of the map. To do this, I have to take all recipes every tick, check if they have the advancement, and if so, give them back their recipes and revoke the advancement. Alternately, I could only take their recipes if they haven't earned the advancement, but even then, if they cross from one biome into the next quickly enough, it will trigger the crash. And we don't want our custom maps completely crashing Minecraft for players, do we?
To reproduce
Run a
/recipe give @p *command in quick oscillating succession with
/recipe take @p *It will crash the game with a Divide By Zero error like the one in the attached crash log. My sparse tests show it won't crash if there are 8 redstone ticks between the commands, but it will crash if there are only 2 redstone ticks between them. More testing can narrow down the range, I'm sure, but I don't think the exact timing is important here.
Why?
Before anyone says "well, don't do that!", there's a legitimate reason to quickly give and take recipes like that. I was using a location-based advancement to test the biome the players are in, and only allow them to craft in certain areas of the map. To do this, I have to take all recipes every tick, check if they have the advancement, and if so, give them back their recipes and revoke the advancement. Alternately, I could only take their recipes if they haven't earned the advancement, but even then, if they cross from one biome into the next quickly enough, it will trigger the crash. And we don't want our custom maps completely crashing Minecraft for players, do we?
To reproduce
Run a
/recipe give @p *command in quick oscillating succession with
/recipe take @p *It will crash the game with a Divide By Zero error like the one in the attached crash
log. My sparse tests show it won't crash if there are 8 redstone ticks between the commands, but it will crash if there are only 2 redstone ticks between them. More testing can narrow down the range, I'm sure, but I don't think the exact timing is important here.
Why?
Before anyone says "well, don't do that!", there's a legitimate reason to quickly give and take recipes like that. I was using a location-based advancement to test the biome the players are in, and only allow them to craft in certain areas of the map. To do this, I have to take all recipes every tick, check if they have the advancement, and if so, give them back their recipes and revoke the advancement. Alternately, I could only take their recipes if they haven't earned the advancement, but even then, if they cross from one biome into the next quickly enough, it will trigger the crash. And we don't want our custom maps completely crashing Minecraft for players, do we?
Divide ByZero crash with alternating /recipe commandsDivision by zero crash with alternating /recipe commands
To reproduce
Run a
/recipe give @p *command in quick oscillating succession with
/recipe take @p *It will crash the game with a Divide By Zero error like the one in the attached crash
log. My sparse tests show it won't crash if there are 8 redstone ticks between the commands, but it will crash if there are only 2 redstone ticks between them. More testing can narrow down the range, I'm sure, but I don't think the exact timing is important here.
Description: Unexpected error java.lang.ArithmeticException: / by zero at bio$b.a(SourceFile:187) at bio.a(SourceFile:44) at bgu.aw(SourceFile:985) at bgu.a(SourceFile:399) at net.minecraft.client.main.Main.main(SourceFile:123)Why?
Before anyone says "well, don't do that!", there's a legitimate reason to quickly give and take recipes like that. I was using a location-based advancement to test the biome the players are in, and only allow them to craft in certain areas of the map. To do this, I have to take all recipes every tick, check if they have the advancement, and if so, give them back their recipes and revoke the advancement. Alternately, I could only take their recipes if they haven't earned the advancement, but even then, if they cross from one biome into the next quickly enough, it will trigger the crash. And we don't want our custom maps completely crashing Minecraft for players, do we?
relates to
is cloned by
relates to
is duplicated by
is duplicated by
Can confirm, looks like a resurgence of MC-115940.
The return of MC-115940?
By the way, as @[Mod] tryashtar said, I think it relates to MC-115940.
It's pretty funny that a division by zero crashes the game xD
It crashes any program as it is an impossible operation.
Shouldn't it just return 0?
No, learn math, it's an impossible to solve problem.