Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

So, I am making a mod where you can summon and deposit an item, but when ever i try to deposit an item/block when you press a key. It keeps crashing with a java.lang.NullPointerException: Ticking entity

 

Crash Log:

 

---- Minecraft Crash Report ----

// I feel sad now :(

 

Time: 7/13/15 11:30 AM

Description: Ticking entity

 

java.lang.NullPointerException: Ticking entity

at net.minecraft.item.ItemStack.updateAnimation(ItemStack.java:498)

at net.minecraft.entity.player.InventoryPlayer.decrementAnimations(InventoryPlayer.java:350)

at net.minecraft.entity.player.EntityPlayer.onLivingUpdate(EntityPlayer.java:623)

at net.minecraft.client.entity.EntityPlayerSP.onLivingUpdate(EntityPlayerSP.java:913)

at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:1828)

at net.minecraft.entity.player.EntityPlayer.onUpdate(EntityPlayer.java:334)

at net.minecraft.client.entity.EntityPlayerSP.onUpdate(EntityPlayerSP.java:165)

at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2031)

at net.minecraft.world.World.updateEntity(World.java:1997)

at net.minecraft.world.World.updateEntities(World.java:1823)

at net.minecraft.client.Minecraft.runTick(Minecraft.java:2184)

at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1087)

at net.minecraft.client.Minecraft.run(Minecraft.java:376)

at net.minecraft.client.main.Main.main(Main.java:117)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:497)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)

at GradleStart.main(Unknown Source)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:497)

at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)

 

 

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

---------------------------------------------------------------------------------------

 

-- Head --

Stacktrace:

at net.minecraft.item.ItemStack.updateAnimation(ItemStack.java:498)

at net.minecraft.entity.player.InventoryPlayer.decrementAnimations(InventoryPlayer.java:350)

at net.minecraft.entity.player.EntityPlayer.onLivingUpdate(EntityPlayer.java:623)

at net.minecraft.client.entity.EntityPlayerSP.onLivingUpdate(EntityPlayerSP.java:913)

at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:1828)

at net.minecraft.entity.player.EntityPlayer.onUpdate(EntityPlayer.java:334)

at net.minecraft.client.entity.EntityPlayerSP.onUpdate(EntityPlayerSP.java:165)

at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2031)

at net.minecraft.world.World.updateEntity(World.java:1997)

 

-- Entity being ticked --

Details:

Entity Type: null (net.minecraft.client.entity.EntityPlayerSP)

Entity ID: 350

Entity Name: Player169

Entity's Exact location: -250.33, 72.00, 263.55

Entity's Block location: -251.00,72.00,263.00 - World: (-251,72,263), Chunk: (at 5,4,7 in -16,16; contains blocks -256,0,256 to -241,255,271), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)

Entity's Momentum: 0.00, -0.08, 0.00

Entity's Rider: ~~ERROR~~ NullPointerException: null

Entity's Vehicle: ~~ERROR~~ NullPointerException: null

Stacktrace:

at net.minecraft.world.World.updateEntities(World.java:1823)

 

-- Affected level --

Details:

Level name: MpServer

All players: 1 total; [EntityPlayerSP['Player169'/350, l='MpServer', x=-250.33, y=72.00, z=263.55]]

Chunk stats: MultiplayerChunkCache: 615, 615

Level seed: 0

Level generator: ID 00 - default, ver 1. Features enabled: false

Level generator options:

Level spawn location: -228.00,64.00,244.00 - World: (-228,64,244), Chunk: (at 12,4,4 in -15,15; contains blocks -240,0,240 to -225,255,255), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)

Level time: 7981 game time, 6000 day time

Level dimension: 0

Level storage version: 0x00000 - Unknown?

Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)

Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false

Forced entities: 96 total; [EntitySpider['Spider'/257, l='MpServer', x=-174.50, y=41.00, z=201.50], EntityEnderman['Enderman'/258, l='MpServer', x=-171.50, y=41.00, z=205.50], EntitySkeleton['Skeleton'/259, l='MpServer', x=-172.56, y=40.00, z=216.09], EntityZombie['Zombie'/264, l='MpServer', x=-173.72, y=22.00, z=296.91], EntityRabbit['Rabbit'/265, l='MpServer', x=-175.63, y=72.00, z=306.34], EntityRabbit['Rabbit'/266, l='MpServer', x=-171.50, y=70.00, z=322.50], EntityZombie['Zombie'/48, l='MpServer', x=-320.72, y=28.44, z=203.69], EntitySpider['Spider'/51, l='MpServer', x=-323.31, y=36.00, z=202.69], EntityEnderman['Enderman'/53, l='MpServer', x=-326.28, y=34.00, z=211.41], EntitySheep['Sheep'/55, l='MpServer', x=-327.38, y=82.00, z=222.44], EntityZombie['Zombie'/56, l='MpServer', x=-326.09, y=18.00, z=226.47], EntitySheep['Sheep'/57, l='MpServer', x=-328.34, y=77.00, z=241.56], EntitySheep['Sheep'/58, l='MpServer', x=-323.53, y=78.00, z=237.44], EntityRabbit['Rabbit'/59, l='MpServer', x=-321.50, y=74.00, z=234.88], EntityRabbit['Rabbit'/61, l='MpServer', x=-330.59, y=74.00, z=243.63], EntitySheep['Sheep'/62, l='MpServer', x=-324.38, y=74.00, z=254.22], EntitySheep['Sheep'/63, l='MpServer', x=-326.88, y=75.00, z=246.84], EntityRabbit['Rabbit'/64, l='MpServer', x=-326.31, y=74.00, z=263.31], EntitySheep['Sheep'/65, l='MpServer', x=-330.88, y=73.00, z=269.19], EntitySkeleton['Skeleton'/66, l='MpServer', x=-323.44, y=64.00, z=265.91], EntityRabbit['Rabbit'/67, l='MpServer', x=-320.63, y=73.00, z=271.38], EntityBat['Bat'/79, l='MpServer', x=-309.75, y=31.10, z=201.47], EntityBat['Bat'/80, l='MpServer', x=-305.91, y=30.10, z=198.25], EntitySkeleton['Skeleton'/81, l='MpServer', x=-312.66, y=49.00, z=205.16], EntityBat['Bat'/82, l='MpServer', x=-315.25, y=26.09, z=229.25], EntityBat['Bat'/83, l='MpServer', x=-314.44, y=29.09, z=209.63], EntitySpider['Spider'/84, l='MpServer', x=-313.28, y=58.00, z=211.28], EntitySheep['Sheep'/85, l='MpServer', x=-315.53, y=74.00, z=241.31], EntityRabbit['Rabbit'/86, l='MpServer', x=-315.41, y=72.00, z=249.44], EntitySheep['Sheep'/87, l='MpServer', x=-316.91, y=73.00, z=267.63], EntitySheep['Sheep'/88, l='MpServer', x=-311.00, y=73.00, z=258.03], EntityCreeper['Creeper'/96, l='MpServer', x=-289.16, y=36.00, z=189.22], EntityRabbit['Rabbit'/97, l='MpServer', x=-297.00, y=71.00, z=189.19], EntityZombie['Zombie'/99, l='MpServer', x=-302.97, y=59.00, z=207.19], EntityZombie['Zombie'/100, l='MpServer', x=-302.00, y=60.00, z=197.00], EntityZombie['Zombie'/101, l='MpServer', x=-298.41, y=60.00, z=200.50], EntitySkeleton['Skeleton'/102, l='MpServer', x=-303.50, y=60.00, z=194.50], EntityRabbit['Rabbit'/103, l='MpServer', x=-299.47, y=71.00, z=226.84], EntitySheep['Sheep'/104, l='MpServer', x=-299.13, y=73.00, z=246.16], EntityRabbit['Rabbit'/115, l='MpServer', x=-285.59, y=65.00, z=186.44], EntityPlayerSP['Player169'/350, l='MpServer', x=-250.33, y=72.00, z=263.55], EntityCreeper['Creeper'/116, l='MpServer', x=-284.06, y=32.00, z=201.41], EntityCreeper['Creeper'/117, l='MpServer', x=-284.06, y=33.00, z=202.53], EntityCreeper['Creeper'/118, l='MpServer', x=-274.22, y=32.16, z=217.34], EntityRabbit['Rabbit'/119, l='MpServer', x=-276.66, y=70.00, z=195.41], EntityZombie['Zombie'/120, l='MpServer', x=-274.31, y=30.02, z=218.28], EntitySkeleton['Skeleton'/121, l='MpServer', x=-278.50, y=31.00, z=218.50], EntityCreeper['Creeper'/122, l='MpServer', x=-275.38, y=30.00, z=218.34], EntityCreeper['Creeper'/123, l='MpServer', x=-282.28, y=31.00, z=212.84], EntityBat['Bat'/124, l='MpServer', x=-270.44, y=25.00, z=221.25], EntitySkeleton['Skeleton'/125, l='MpServer', x=-284.53, y=61.00, z=224.88], EntitySkeleton['Skeleton'/126, l='MpServer', x=-287.75, y=59.00, z=231.09], EntityRabbit['Rabbit'/127, l='MpServer', x=-285.19, y=71.00, z=237.34], EntityItem['item.tile.flower1.dandelion'/128, l='MpServer', x=-272.22, y=70.00, z=261.56], EntityRabbit['Rabbit'/129, l='MpServer', x=-272.59, y=76.00, z=289.63], EntitySpider['Spider'/130, l='MpServer', x=-280.72, y=28.09, z=330.03], EntitySheep['Sheep'/140, l='MpServer', x=-251.56, y=67.00, z=187.22], EntitySheep['Sheep'/141, l='MpServer', x=-265.69, y=69.00, z=207.41], EntitySheep['Sheep'/142, l='MpServer', x=-257.81, y=67.00, z=194.34], EntitySheep['Sheep'/143, l='MpServer', x=-265.03, y=69.00, z=200.88], EntityCreeper['Creeper'/144, l='MpServer', x=-260.00, y=31.00, z=214.50], EntityZombie['Zombie'/145, l='MpServer', x=-266.50, y=29.00, z=215.50], EntityBat['Bat'/146, l='MpServer', x=-270.63, y=24.88, z=223.69], EntityBat['Bat'/147, l='MpServer', x=-268.75, y=25.10, z=250.44], EntityItem['item.tile.flower2.poppy'/148, l='MpServer', x=-256.34, y=75.00, z=279.59], EntityRabbit['Rabbit'/149, l='MpServer', x=-265.06, y=72.00, z=334.75], EntityZombie['Zombie'/154, l='MpServer', x=-259.22, y=30.00, z=213.28], EntityRabbit['Rabbit'/155, l='MpServer', x=-253.13, y=66.00, z=197.16], EntitySkeleton['Skeleton'/156, l='MpServer', x=-253.72, y=32.00, z=223.19], EntitySkeleton['Skeleton'/157, l='MpServer', x=-252.94, y=34.00, z=224.41], EntitySkeleton['Skeleton'/158, l='MpServer', x=-254.69, y=32.00, z=224.69], EntityRabbit['Rabbit'/159, l='MpServer', x=-246.19, y=73.00, z=273.47], EntityRabbit['Rabbit'/160, l='MpServer', x=-258.69, y=74.00, z=298.47], EntityRabbit['Rabbit'/161, l='MpServer', x=-236.28, y=69.00, z=303.56], EntityItem['item.tile.grass'/165, l='MpServer', x=-227.66, y=67.00, z=251.88], EntityRabbit['Rabbit'/166, l='MpServer', x=-232.50, y=69.00, z=287.84], EntitySkeleton['Skeleton'/186, l='MpServer', x=-219.56, y=13.00, z=200.16], EntitySkeleton['Skeleton'/187, l='MpServer', x=-213.44, y=15.00, z=194.56], EntityRabbit['Rabbit'/188, l='MpServer', x=-213.50, y=70.00, z=262.59], EntityEnderman['Enderman'/189, l='MpServer', x=-207.78, y=30.00, z=332.47], EntityRabbit['Rabbit'/190, l='MpServer', x=-220.22, y=70.00, z=341.56], EntityCreeper['Creeper'/209, l='MpServer', x=-202.00, y=18.00, z=191.63], EntitySpider['Spider'/210, l='MpServer', x=-205.13, y=16.00, z=188.69], EntitySkeleton['Skeleton'/211, l='MpServer', x=-194.53, y=19.00, z=184.88], EntityCreeper['Creeper'/212, l='MpServer', x=-202.31, y=16.00, z=190.59], EntityRabbit['Rabbit'/213, l='MpServer', x=-194.19, y=74.00, z=240.47], EntityZombie['Zombie'/214, l='MpServer', x=-201.50, y=31.00, z=333.50], EntityZombie['Zombie'/231, l='MpServer', x=-191.50, y=18.00, z=185.50], EntityZombie['Zombie'/234, l='MpServer', x=-182.75, y=21.00, z=194.44], EntityZombie['Zombie'/236, l='MpServer', x=-181.94, y=46.00, z=197.38], EntityRabbit['Rabbit'/237, l='MpServer', x=-190.28, y=76.00, z=234.97], EntityRabbit['Rabbit'/238, l='MpServer', x=-181.31, y=75.00, z=258.25], EntityZombie['Zombie'/239, l='MpServer', x=-184.72, y=26.28, z=308.69], EntityZombie['Zombie'/240, l='MpServer', x=-180.50, y=25.00, z=334.50], EntityRabbit['Rabbit'/241, l='MpServer', x=-188.44, y=70.00, z=324.44], EntityZombie['Zombie'/255, l='MpServer', x=-174.00, y=23.00, z=197.41]]

Retry entities: 0 total; []

Server brand: fml,forge

Server type: Integrated singleplayer server

Stacktrace:

at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:392)

at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2614)

at net.minecraft.client.Minecraft.run(Minecraft.java:398)

at net.minecraft.client.main.Main.main(Main.java:117)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:497)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)

at GradleStart.main(Unknown Source)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:497)

at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)

 

-- System Details --

Details:

Minecraft Version: 1.8

Operating System: Windows 8.1 (amd64) version 6.3

Java Version: 1.8.0_45, Oracle Corporation

Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation

Memory: 704159112 bytes (671 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)

JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

IntCache: cache: 5, tcache: 0, allocated: 13, tallocated: 95

FML: MCP v9.10 FML v8.0.99.99 Minecraft Forge 11.14.3.1450 4 mods loaded, 4 mods active

States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored

UCHIJAAAA mcp{9.05} [Minecraft Coder Pack] (minecraft.jar)

UCHIJAAAA FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.8-11.14.3.1450.jar)

UCHIJAAAA Forge{11.14.3.1450} [Minecraft Forge] (forgeSrc-1.8-11.14.3.1450.jar)

UCHIJAAAA summonercraft{1.0} [summonercraft] (Summonercraft)

Loaded coremods (and transformers):

GL info: ' Vendor: 'Intel' Version: '4.2.0 - Build 10.18.10.3412' Renderer: 'Intel® HD Graphics 4400'

Launched Version: 1.8

LWJGL: 2.9.1

OpenGL: Intel® HD Graphics 4400 GL version 4.2.0 - Build 10.18.10.3412, Intel

GL Caps: Using GL 1.3 multitexturing.

Using GL 1.3 texture combiners.

Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.

Shaders are available because OpenGL 2.1 is supported.

VBOs are available because OpenGL 1.5 is supported.

 

Using VBOs: No

Is Modded: Definitely; Client brand changed to 'fml,forge'

Type: Client (map_client.txt)

Resource Packs: []

Current Language: English (US)

Profiler Position: N/A (disabled)

 

 

Main Class:

 

package rainbow.summonercraft;

 

 

import net.minecraft.client.settings.KeyBinding;

import net.minecraftforge.common.MinecraftForge;

import net.minecraftforge.fml.client.registry.ClientRegistry;

import net.minecraftforge.fml.common.FMLCommonHandler;

import net.minecraftforge.fml.common.Mod;

import net.minecraftforge.fml.common.SidedProxy;

import net.minecraftforge.fml.common.event.FMLInitializationEvent;

import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;

import org.lwjgl.input.Keyboard;

import rainbow.summonercraft.init.ModBlocks;

import rainbow.summonercraft.init.ModItems;

import rainbow.summonercraft.proxy.CommonProxy;

 

@Mod(modid = ModInfo.modid, name = ModInfo.modname, version = ModInfo.version)

public class SummonCraft {

 

    @SidedProxy(clientSide = ModInfo.clientproxy,

            serverSide = ModInfo.serverproxy)

    public static CommonProxy proxy;

 

    @Mod.EventHandler

    public void preInit(FMLPreInitializationEvent event) {

 

        ModBlocks.init();

        ModBlocks.register();

        ModItems.init();

        ModItems.register();

 

        FMLCommonHandler.instance().bus().register(new ModdedEventHandler());

        proxy.init();

    }

 

    @Mod.EventHandler

    public void init(FMLInitializationEvent event) {

 

        proxy.registerRenders();

    }

 

    @Mod.EventHandler

    public void postInit(FMLPostInitializationEvent event) {

 

    }

}

 

 

 

Keybinding Class(init method):

 

package rainbow.summonercraft.proxy;

 

import net.minecraft.client.settings.KeyBinding;

import net.minecraftforge.fml.client.registry.ClientRegistry;

import org.lwjgl.input.Keyboard;

import rainbow.summonercraft.init.ModBlocks;

import rainbow.summonercraft.init.ModItems;

 

public class ClientProxy extends CommonProxy {

 

    public static KeyBinding[] keyBindings;

 

    @Override

    public void registerRenders() {

 

        ModBlocks.registerRenders();

        ModItems.registerRenders();

    }

 

    @Override

    public void init() {

 

        keyBindings = new KeyBinding[1];

 

 

        keyBindings[0] = new KeyBinding("key.summon.desc", Keyboard.KEY_X, "key.summoncraft.category");

 

 

        for (int i = 0; i < keyBindings.length; ++i)

        {

            ClientRegistry.registerKeyBinding(keyBindings);

        }

    }

}

 

 

 

EventHandler:

 

package rainbow.summonercraft;

 

import net.minecraft.client.Minecraft;

import net.minecraft.client.settings.KeyBinding;

import net.minecraft.entity.player.EntityPlayer;

import net.minecraft.item.ItemStack;

import net.minecraft.util.ChatComponentText;

import net.minecraft.util.IChatComponent;

import net.minecraftforge.fml.common.eventhandler.EventPriority;

import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;

import net.minecraftforge.fml.common.gameevent.InputEvent;

import net.minecraftforge.fml.relauncher.Side;

import net.minecraftforge.fml.relauncher.SideOnly;

import rainbow.summonercraft.proxy.ClientProxy;

 

public class ModdedEventHandler {

 

    public static ItemStack itemstack;

 

    @SubscribeEvent(priority=EventPriority.NORMAL, receiveCanceled=true)

    public void onEvent(InputEvent.KeyInputEvent event) {

 

        KeyBinding[] keyBindings = ClientProxy.keyBindings;

        EntityPlayer p = Minecraft.getMinecraft().thePlayer;

 

        if (keyBindings[0].isPressed()) {

 

            if(itemstack == null) {

 

                if(p.getHeldItem() == null) {

                    p.addChatMessage(new ChatComponentText("[summonercraft] You do not have an item in your hand!"));

                    return;

                }

                itemstack = p.getHeldItem();

                p.getHeldItem().setItem(null);

                p.addChatMessage(new ChatComponentText("[summonercraft] Your item has been desposited"));

            }else if(itemstack != null) {

 

                if(p.getHeldItem() == null) {

 

                    p.getHeldItem().setItem(itemstack.getItem());

                    itemstack = null;

                    p.addChatMessage(new ChatComponentText("[summonercraft] Your item has been summoned!"));

                    return;

                }

                ItemStack stack = p.getHeldItem();

 

                p.getHeldItem().setItem(itemstack.getItem());

                itemstack = stack;

                p.addChatMessage(new ChatComponentText("[summonercraft] Your item has been exchanged!"));

            }

 

 

        }

 

    }

 

 

}

 

 

  • Author

You cannot do it that way. KeyHandlers are entirely client side, you cannot modify the player inventory on the client. You need packets.

 

thanks ^_^

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.