Game crashes on GUI opening

Status
Works as designed
Issue description

So I have a problem when I right-click my custom crafting block, the game crashes instead of opening the GUI. If anyone can find a fix, that would be extremely appreciated!

 

---Crash Report---

---- Minecraft Crash Report ----
// Shall we play a game?

Time: 6/9/19 5:57 PM
Description: Ticking player

java.lang.ArrayIndexOutOfBoundsException: 5
    at java.util.Arrays$ArrayList.get(Arrays.java:3841)
    at net.minecraft.util.NonNullList.get(NonNullList.java:51)
    at mod.mcreator.mcreator_runeInfuser$TileEntityCustom.getStackInSlot(mcreator_runeInfuser.java:177)
    at net.minecraft.inventory.Slot.getStack(Slot.java:81)
    at net.minecraft.inventory.Container.detectAndSendChanges(Container.java:97)
    at net.minecraft.entity.player.EntityPlayerMP.onUpdate(EntityPlayerMP.java:365)
    at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2171)
    at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:871)
    at net.minecraft.world.World.updateEntity(World.java:2130)
    at net.minecraft.world.WorldServer.tickPlayers(WorldServer.java:672)
    at net.minecraft.world.World.updateEntities(World.java:1906)
    at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:643)
    at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:842)
    at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:743)
    at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:192)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:592)
    at java.lang.Thread.run(Thread.java:748)

A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: Server thread
Stacktrace:
    at java.util.Arrays$ArrayList.get(Arrays.java:3841)
    at net.minecraft.util.NonNullList.get(NonNullList.java:51)
    at mod.mcreator.mcreator_runeInfuser$TileEntityCustom.getStackInSlot(mcreator_runeInfuser.java:177)
    at net.minecraft.inventory.Slot.getStack(Slot.java:81)
    at net.minecraft.inventory.Container.detectAndSendChanges(Container.java:97)
    at net.minecraft.entity.player.EntityPlayerMP.onUpdate(EntityPlayerMP.java:365)
    at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2171)
    at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:871)
    at net.minecraft.world.World.updateEntity(World.java:2130)

-- Player being ticked --
Details:
    Entity Type: null (net.minecraft.entity.player.EntityPlayerMP)
    Entity ID: 144
    Entity Name: Player593
    Entity's Exact location: -2732.47, 4.00, 213.39
    Entity's Block location: World: (-2733,4,213), Chunk: (at 3,0,5 in -171,13; contains blocks -2736,0,208 to -2721,255,223), Region: (-6,0; contains chunks -192,0 to -161,31, blocks -3072,0,0 to -2561,255,511)
    Entity's Momentum: 0.00, -0.08, 0.00
    Entity's Passengers: []
    Entity's Vehicle: ~~ERROR~~ NullPointerException: null
Stacktrace:
    at net.minecraft.world.WorldServer.tickPlayers(WorldServer.java:672)
    at net.minecraft.world.World.updateEntities(World.java:1906)
    at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:643)

-- Affected level --
Details:
    Level name: New Worldaaaa
    All players: 1 total; [EntityPlayerMP['Player593'/144, l='New Worldaaaa', x=-2732.47, y=4.00, z=213.39]]
    Chunk stats: ServerChunkCache: 2401 Drop: 0
    Level seed: -452128480482608313
    Level generator: ID 01 - flat, ver 0. Features enabled: true
    Level generator options: 
    Level spawn location: World: (-2751,4,183), Chunk: (at 1,0,7 in -172,11; contains blocks -2752,0,176 to -2737,255,191), Region: (-6,0; contains chunks -192,0 to -161,31, blocks -3072,0,0 to -2561,255,511)
    Level time: 29772 game time, 29772 day time
    Level dimension: 0
    Level storage version: 0x04ABD - Anvil
    Level weather: Rain time: 39446 (now: false), thunder time: 124916 (now: false)
    Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: true
Stacktrace:
    at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:842)
    at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:743)
    at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:192)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:592)
    at java.lang.Thread.run(Thread.java:748)

-- System Details --
Details:
    Minecraft Version: 1.12.2
    Operating System: Windows 10 (amd64) version 10.0
    Java Version: 1.8.0_202, BellSoft
    Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), BellSoft
    Memory: 800637880 bytes (763 MB) / 1081081856 bytes (1031 MB) up to 1895825408 bytes (1808 MB)
    JVM Flags: 0 total; 
    IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
    FML: MCP 9.42 Powered by Forge 14.23.5.2768 5 mods loaded, 5 mods active
    States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored

    | State     | ID        | Version      | Source                           | Signature |
    |:--------- |:--------- |:------------ |:-------------------------------- |:--------- |
    | UCHIJAAAA | minecraft | 1.12.2       | minecraft.jar                    | None      |
    | UCHIJAAAA | mcp       | 9.42         | minecraft.jar                    | None      |
    | UCHIJAAAA | FML       | 8.0.99.99    | forgeSrc-1.12.2-14.23.5.2768.jar | None      |
    | UCHIJAAAA | forge     | 14.23.5.2768 | forgeSrc-1.12.2-14.23.5.2768.jar | None      |
    | UCHIJAAAA | tyonia    | 1.0.0        | modid-1.0.jar                    | None      |

    Loaded coremods (and transformers): 
    GL info: ~~ERROR~~ RuntimeException: No OpenGL context found in the current thread.
    Profiler Position: N/A (disabled)
    Player Count: 1 / 8; [EntityPlayerMP['Player593'/144, l='New Worldaaaa', x=-2732.47, y=4.00, z=213.39]]
    Type: Integrated Server (map_client.txt)
    Is Modded: Definitely; Client brand changed to 'fml,forge'

Issue comments

You are calling slot with ID 5. The block you bound GUI to or the inventory you created for the GUI needs to have at least 6 slots to support this as IDs start with 0.