![Function API](https://media.forgecdn.net/avatars/thumbnails/225/971/256/256/637042619739144499.png)
[solved] Crashes when *use on block* method is activated
DecimJaeger opened this issue ยท 11 comments
---- Minecraft Crash Report ----
// Who set us up the TNT?
Time: 10/12/19 11:39 PM
Description: Unexpected error
java.lang.NullPointerException: Unexpected error
at net.minecraft.class_1792.handler$useOnBlock$zdk001(class_1792.java:1047)
at net.minecraft.class_1792.method_7884(class_1792.java:185)
at net.minecraft.class_1799.method_7981(class_1799.java:189)
at net.minecraft.class_636.method_2896(class_636.java:325)
at net.optifine.override.PlayerControllerOF.method_2896(PlayerControllerOF.java:98)
at net.minecraft.class_310.method_1583(class_310.java:1335)
at net.minecraft.class_310.method_1508(class_310.java:1562)
at net.minecraft.class_310.method_1574(class_310.java:1411)
at net.minecraft.class_310.method_1523(class_310.java:925)
at net.minecraft.class_310.method_1514(class_310.java:410)
at net.minecraft.client.main.Main.main(Main.java:155)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.fabricmc.loader.game.MinecraftGameProvider.launch(MinecraftGameProvider.java:178)
at net.fabricmc.loader.launch.knot.Knot.init(Knot.java:131)
at net.fabricmc.loader.launch.knot.KnotClient.main(KnotClient.java:26)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:196)
at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:231)
at org.multimc.EntryPoint.listen(EntryPoint.java:143)
at org.multimc.EntryPoint.main(EntryPoint.java:34)
A detailed walkthrough of the error, its code path and all known details is as follows:
-- Head --
Thread: Client thread
Stacktrace:
at net.minecraft.class_1792.handler$useOnBlock$zdk001(class_1792.java:1047)
at net.minecraft.class_1792.method_7884(class_1792.java:185)
at net.minecraft.class_1799.method_7981(class_1799.java:189)
at net.minecraft.class_636.method_2896(class_636.java:325)
at net.optifine.override.PlayerControllerOF.method_2896(PlayerControllerOF.java:98)
at net.minecraft.class_310.method_1583(class_310.java:1335)
at net.minecraft.class_310.method_1508(class_310.java:1562)
-- Affected level --
Details:
All players: 1 total; [class_746['DecimJaeger98'/125, l='MpServer', x=-269.80, y=4.00, z=-61.01]]
Chunk stats: Client Chunk Cache: 361, 225
Level dimension: minecraft:overworld
Level name: MpServer
Level seed: 0
Level generator: ID 01 - flat, ver 0. Features enabled: false
Level generator options: {}
Level spawn location: World: (-240,4,-64), Chunk: (at 0,0,0 in -15,-4; contains blocks -240,0,-64 to -225,255,-49), Region: (-1,-1; contains chunks -32,-32 to -1,-1, blocks -512,0,-512 to -1,255,-1)
Level time: 7443830 game time, 1000 day time
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
Server brand: fabric
Server type: Integrated singleplayer server
Stacktrace:
at net.minecraft.class_638.method_8538(class_638.java:574)
at net.minecraft.class_310.method_1587(class_310.java:1923)
at net.minecraft.class_310.method_1514(class_310.java:430)
at net.minecraft.client.main.Main.main(Main.java:155)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.fabricmc.loader.game.MinecraftGameProvider.launch(MinecraftGameProvider.java:178)
at net.fabricmc.loader.launch.knot.Knot.init(Knot.java:131)
at net.fabricmc.loader.launch.knot.KnotClient.main(KnotClient.java:26)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:196)
at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:231)
at org.multimc.EntryPoint.listen(EntryPoint.java:143)
at org.multimc.EntryPoint.main(EntryPoint.java:34)
-- System Details --
Details:
Minecraft Version: 1.14.4
Minecraft Version ID: 1.14.4
Operating System: Windows 10 (amd64) version 10.0
Java Version: 1.8.0_221, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 4025573232 bytes (3839 MB) / 6102188032 bytes (5819 MB) up to 6102188032 bytes (5819 MB)
CPUs: 4
JVM Flags: 3 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xms3072m -Xmx6144m
Fabric Mods:
adorn: Adorn 1.4.1+1.14.4
antiqueatlas: Antique Atlas 5.1.1-fabric
appleskin: AppleSkin 1.0.7
artifice: Artifice 0.3.4
bambootweaks: Bamboo Tweaks 1.14.4-1.1.0
biow0rks: biow0rk5 0.2.3
cloth: Cloth Events 0.6.0
cloth-config2: Cloth Config v2 1.1.2
coloredinnerwool: Colored Inner Wool 0.2.0
cotton: Cotton 1.0.0-rc.3
cotton-cauldron: Cotton Cauldron 1.0.0-rc.1
cotton-commons: Cotton Commons 1.0.0-rc.3
cotton-config: Cotton Config 1.0.0-rc.1
cotton-datapack: Cotton Datapack 1.0.0-rc.1
cotton-logging: Cotton Logging 1.0.0-rc.1
cotton-player-events: Cotton Player Events 1.0.0-rc.2
crafty: Crafty 0.3.3+1.14.1
extrapieces: Extra Pieces 2.8.1
fabric: Fabric API 0.4.0+build.240-1.14
fabric-api-base: fabric-api-base 0.1.0+59147463
fabric-biomes-v1: Fabric Biomes (v1) 0.1.0+591e97ae42
fabric-commands-v0: Fabric Commands (v0) 0.1.1+591e97ae42
fabric-containers-v0: Fabric Containers (v0) 0.1.2+591e97ae42
fabric-content-registries-v0: Fabric Content Registries (v0) 0.1.1+591e97ae42
fabric-crash-report-info-v1: Fabric Crash Report Info (v1) 0.1.1+591e97ae42
fabric-dimensions-v1: fabric-dimensions-v1 0.1.0+369ab22e42
fabric-events-interaction-v0: Fabric Events Interaction (v0) 0.1.1+591e97ae42
fabric-events-lifecycle-v0: Fabric Events Lifecycle (v0) 0.1.1+591e97ae42
fabric-item-groups-v0: Fabric Item Groups (v0) 0.1.0+591e97ae42
fabric-keybindings-v0: Fabric Key Bindings (v0) 0.1.1+591e97ae42
fabric-language-kotlin: Fabric Language Kotlin 1.3.50+build.1
fabric-loot-tables-v1: Fabric Loot Tables (v1) 0.1.0+591e97ae42
fabric-mining-levels-v0: Fabric Mining Levels (v0) 0.1.0+591e97ae42
fabric-models-v0: Fabric Models (v0) 0.1.0+591e97ae42
fabric-networking-blockentity-v0: Fabric Networking Block Entity (v0) 0.2.0+c877038942
fabric-networking-v0: fabric-networking-v0 0.1.3+9f55aa7042
fabric-object-builders-v0: Fabric Object Builders (v0) 0.1.1+591e97ae42
fabric-particles-v1: fabric-particles-v1 0.1.1+c877038942
fabric-registry-sync-v0: Fabric Registry Sync (v0) 0.2.2+591e97ae42
fabric-renderer-api-v1: Fabric Renderer API (v1) 0.1.1+591e97ae42
fabric-renderer-indigo: Fabric Renderer - Indigo 0.1.13+591e97ae42
fabric-rendering-data-attachment-v1: Fabric Rendering Data Attachment (v1) 0.1.1+c877038942
fabric-rendering-fluids-v1: Fabric Rendering Fluids (v1) 0.1.2+36f27aa342
fabric-rendering-v0: Fabric Rendering (v0) 0.1.1+591e97ae42
fabric-resource-loader-v0: Fabric Resource Loader (v0) 0.1.3+591e97ae42
fabric-tag-extensions-v0: Fabric Tag Extensions (v0) 0.1.1+591e97ae42
fabric-textures-v0: Fabric Textures (v0) 0.1.4+591e97ae42
fabricloader: Fabric Loader 0.6.3+build.167
fiber2cloth: Fiber To Cloth 1.2.0
function_api: Function API 1.2.0
jankson: Jankson 1.0.0+j1.1.2
libcd: LibCapableData 1.3.1+1.14.4
libgui: LibGui 1.3.2
mambience: MAmbience 0.6.1
me_zeroeightsix_fiber: fiber 0.6.0-7
minecraft: Minecraft 1.14.4
missingbits: Missing Bits v1.14.4 Fabric b4
ml3lib: ML3 Library 1.0.0
mm: Manningham Mills 1.6
modmenu: Mod Menu 1.7.11+build.121
moenchantments: Mo'Enchantments 1.7.1
nbtcrafting: NBT Crafting 1.2.4+1.14.4
nbttooltip: NBT Tooltip 1.14-1.0.3
net_fabricmc_stitch: stitch 0.2.1.61
optifabric: Optifabric 0.5.2
org_jetbrains_annotations: annotations 17.0.0
org_jetbrains_kotlin_kotlin-reflect: kotlin-reflect 1.3.50
org_jetbrains_kotlin_kotlin-stdlib: kotlin-stdlib 1.3.50
org_jetbrains_kotlin_kotlin-stdlib-jdk8: kotlin-stdlib-jdk8 1.3.50
org_jetbrains_kotlinx_kotlinx-coroutines-core: kotlinx-coroutines-core 1.3.0
org_jetbrains_kotlinx_kotlinx-coroutines-jdk8: kotlinx-coroutines-jdk8 1.3.0
org_slf4j_slf4j-api: slf4j-api 1.7.26
org_slf4j_slf4j-simple: slf4j-simple 1.7.26
org_zeroturnaround_zt-zip: zt-zip 1.13
pushable: Pushable Block Entities 1.0.0
roughlyenoughitems: Roughly Enough Items 3.1.4+build.21
satin: Satin 1.3.2
snm: Secrets No More 1.0.1
sweettooth: Sweet Tooth 1.0.1
towelette: Towelette 1.10.1
verticalredstone: Vertical Redstone 1.0.1
Launched Version: MultiMC5
LWJGL: 3.2.2 build 10
OpenGL: GeForce GTX 1050 Ti/PCIe/SSE2 GL version 4.6.0 NVIDIA 436.48, NVIDIA Corporation
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: Yes
Is Modded: Definitely; Client brand changed to 'fabric'
Type: Client (map_client.txt)
Resource Packs: vanilla, file/Gaming Resource Pack 1.14.4 - v2.5.zip, file/CustomItemsModel.zip, file/Colorful Cauldron resourcepack v1.0.0.zip
Current Language: English (US)
CPU: 4x Intel(R) Core(TM) i5-7400 CPU @ 3.00GHz
I right-clicked on the ground with a totem of undying; I wrote a function that place a block when you right click with it. It worked with the previous version.
what was in the function? I ask that because some commands with all of the mods I use e.g. recipe give @s * will give me a fatal arithmetic error
but yeah my only guess is that something broke when frontrider added the set tag
this is the function:
execute if entity @p[y_rotation=51..140] if block ~ ~1 ~ minecraft:air run setblock ~ ~1 ~ furniture:totem_of_undying_west
execute if entity @p[y_rotation=51..140] if block ~ ~1 ~ minecraft:water run setblock ~ ~1 ~ furniture:totem_of_undying_west[fluid= minecraft_water_9]
execute if entity @p[y_rotation=141..230] if block ~ ~1 ~ minecraft:air run setblock ~ ~1 ~ furniture:totem_of_undying_north
execute if entity @p[y_rotation=141..230] if block ~ ~1 ~ minecraft:water run setblock ~ ~1 ~ furniture:totem_of_undying_north[fluid= minecraft_water_9]
execute if entity @p[y_rotation=231..320] if block ~ ~1 ~ minecraft:air run setblock ~ ~1 ~ furniture:totem_of_undying_east
execute if entity @p[y_rotation=231..320] if block ~ ~1 ~ minecraft:water run setblock ~ ~1 ~ furniture:totem_of_undying_east[fluid= minecraft_water_9]
execute if entity @p[y_rotation=321..50] if block ~ ~1 ~ minecraft:air run setblock ~ ~1 ~ furniture:totem_of_undying_south
execute if entity @p[y_rotation=321..50] if block ~ ~1 ~ minecraft:water run setblock ~ ~1 ~ furniture:totem_of_undying_south[fluid= minecraft_water_9]
execute if entity @p[gamemode=survival] run clear @p minecraft:totem_of_undying 1
basically I created 4 blocks ,with a mod called Crafty, that have the shape of a totem of undying and ,based in the direction the player is looking, it places them when I right-click with the totem on the ground
I don't know if this is the root cause of the issue, but I am noticing that these events are still on Item
instead of ItemStack
. @Frontrider that might wanna be changed, like with the block ones being moved to the BlockState.
so is there something that I have to change in the format? or am I missing some changes?
just to be sure I will also provide the folders location:
minecraft\tags\functions\function_api\item\totem_of_undying\use_on_block.json
use_on_block.json:
{
"replace": false,
"values": [
"test:placeable_totem"
]
}
test\functions\placeable_totem
Definitely. One benefit of using function files is that it absolutely can't crash the game from user error.
Added the new code that I have made explicitly against null pointers and I can no longer reproduce the issue with any item.
My own script for item tests (put down fire above the block I clicked with a stick) still works ๐.