Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.16.1]Block Properties
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 0
Luis_ST

[1.16.1]Block Properties

By Luis_ST, December 2, 2020 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

Luis_ST    0

Luis_ST

Luis_ST    0

  • Creeper Killer
  • Luis_ST
  • Members
  • 0
  • 150 posts
Posted December 2, 2020

Is there a way to set the Block Propertie ".doesNotBlockMovement()" only if the player has an Enchantment

  • Quote

Share this post


Link to post
Share on other sites

Draco18s    2406

Draco18s

Draco18s    2406

  • Reality Controller
  • Draco18s
  • Members
  • 2406
  • 15940 posts
Posted December 2, 2020

Not really no. I did something like this a long while back, but you can't fiddle with that property. You have to fiddle with whatever you can do with the available methods. e.g. you can return an empty voxel shape from getCollisionShape which does allow you to check what the player has or is.

  • Thanks 1
  • Quote

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Share this post


Link to post
Share on other sites

Luis_ST    0

Luis_ST

Luis_ST    0

  • Creeper Killer
  • Luis_ST
  • Members
  • 0
  • 150 posts
Posted December 2, 2020

okay thanks

  • Quote

Share this post


Link to post
Share on other sites

Luis_ST    0

Luis_ST

Luis_ST    0

  • Creeper Killer
  • Luis_ST
  • Members
  • 0
  • 150 posts
Posted December 2, 2020 (edited)
1 hour ago, Draco18s said:

Not really no. I did something like this a long while back, but you can't fiddle with that property. You have to fiddle with whatever you can do with the available methods. e.g. you can return an empty voxel shape from getCollisionShape which does allow you to check what the player has or is.

i creat this but i get an error when i remove try catch:

 

	@Override
	public VoxelShape getCollisionShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
		
		PlayerEntity player = (PlayerEntity) context.getEntity();
		
		try {
			
			if (player.inventory.armorItemInSlot(0).getItem() == Items.LEATHER_BOOTS) {
				
				return VoxelShapes.fullCube();
				
			} else {
				
				return VoxelShapes.empty();
				
			}
			
		} catch (Exception e) {
			
			return VoxelShapes.empty();
			
		}
		
	}

 

net.minecraft.crash.ReportedException: Rendering overlay
	at net.minecraft.client.renderer.GameRenderer.updateCameraAndRender(GameRenderer.java:489) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:988) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.Minecraft.run(Minecraft.java:587) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.main.Main.main(Main.java:184) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {}
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?] {}
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {}
	at java.lang.reflect.Method.invoke(Method.java:564) ~[?:?] {}
	at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55) ~[forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-6.1.3.jar:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-6.1.3.jar:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-6.1.3.jar:?] {}
	at cpw.mods.modlauncher.Launcher.run(Launcher.java:81) [modlauncher-6.1.3.jar:?] {}
	at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) [modlauncher-6.1.3.jar:?] {}
	at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:105) [forge-1.16.1-32.0.108_mapped_snapshot_20200514-1.16-recomp.jar:?] {}
Caused by: java.lang.NullPointerException
	at net.luis.cave.blocks.PowderSnow.getCollisionShape(PowderSnow.java:62) ~[?:?] {re:classloading}
	at net.minecraft.block.AbstractBlock$AbstractBlockState$Cache.<init>(AbstractBlock.java:845) ~[?:?] {re:classloading}
	at net.minecraft.block.AbstractBlock$AbstractBlockState$Cache.<init>(AbstractBlock.java:817) ~[?:?] {re:classloading}
	at net.minecraft.block.AbstractBlock$AbstractBlockState.cacheState(AbstractBlock.java:470) ~[?:?] {re:classloading}
	at net.minecraftforge.registries.GameData$BlockCallbacks.onBake(GameData.java:474) ~[?:?] {re:classloading}
	at net.minecraftforge.registries.ForgeRegistry.bake(ForgeRegistry.java:503) ~[?:?] {re:classloading}
	at net.minecraftforge.registries.GameData.lambda$freezeData$5(GameData.java:330) ~[?:?] {re:classloading}
	at com.google.common.collect.HashBiMap.forEach(HashBiMap.java:528) ~[guava-21.0.jar:?] {}
	at net.minecraftforge.registries.GameData.freezeData(GameData.java:328) ~[?:?] {re:classloading}
	at net.minecraftforge.fml.ModLoader.finishMods(ModLoader.java:273) ~[?:?] {re:classloading}
	at net.minecraftforge.fml.client.ClientModLoader.lambda$finishModLoading$7(ClientModLoader.java:131) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$5(ClientModLoader.java:109) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraftforge.fml.client.ClientModLoader.finishModLoading(ClientModLoader.java:131) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraftforge.fml.client.ClientModLoader.lambda$onreload$4(ClientModLoader.java:103) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
	at java.util.concurrent.CompletableFuture$UniRun.tryFire(CompletableFuture.java:783) ~[?:?] {}
	at java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:479) ~[?:?] {}
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) ~[?:?] {}
	at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1016) ~[?:?] {}
	at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1665) ~[?:?] {}
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1598) ~[?:?] {}
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183) ~[?:?] {}
[m[32m[17:40:03] [Render thread/INFO] [STDOUT/]: [net.minecraft.util.registry.Bootstrap:printToSYSOUT:127]: ---- Minecraft Crash Report ----
// I let you down. Sorry :(

Time: 02.12.20, 17:40
Description: Rendering overlay

java.lang.NullPointerException: Rendering overlay
	at net.luis.cave.blocks.PowderSnow.getCollisionShape(PowderSnow.java:62) ~[?:?] {re:classloading}
	at net.minecraft.block.AbstractBlock$AbstractBlockState$Cache.<init>(AbstractBlock.java:845) ~[?:?] {re:classloading}
	at net.minecraft.block.AbstractBlock$AbstractBlockState$Cache.<init>(AbstractBlock.java:817) ~[?:?] {re:classloading}
	at net.minecraft.block.AbstractBlock$AbstractBlockState.cacheState(AbstractBlock.java:470) ~[?:?] {re:classloading}
	at net.minecraftforge.registries.GameData$BlockCallbacks.onBake(GameData.java:474) ~[?:?] {re:classloading}
	at net.minecraftforge.registries.ForgeRegistry.bake(ForgeRegistry.java:503) ~[?:?] {re:classloading}
	at net.minecraftforge.registries.GameData.lambda$freezeData$5(GameData.java:330) ~[?:?] {re:classloading}
	at com.google.common.collect.HashBiMap.forEach(HashBiMap.java:528) ~[guava-21.0.jar:?] {}
	at net.minecraftforge.registries.GameData.freezeData(GameData.java:328) ~[?:?] {re:classloading}
	at net.minecraftforge.fml.ModLoader.finishMods(ModLoader.java:273) ~[?:?] {re:classloading}
	at net.minecraftforge.fml.client.ClientModLoader.lambda$finishModLoading$7(ClientModLoader.java:131) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$5(ClientModLoader.java:109) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraftforge.fml.client.ClientModLoader.finishModLoading(ClientModLoader.java:131) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraftforge.fml.client.ClientModLoader.lambda$onreload$4(ClientModLoader.java:103) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
	at java.util.concurrent.CompletableFuture$UniRun.tryFire(CompletableFuture.java:783) ~[?:?] {}
	at java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:479) ~[?:?] {}
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) ~[?:?] {}
	at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1016) ~[?:?] {}
	at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1665) ~[?:?] {}
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1598) ~[?:?] {}
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183) ~[?:?] {}

 

Edited December 2, 2020 by Luis_ST
  • Quote

Share this post


Link to post
Share on other sites

Draco18s    2406

Draco18s

Draco18s    2406

  • Reality Controller
  • Draco18s
  • Members
  • 2406
  • 15940 posts
Posted December 2, 2020

What happens if the entity isn't a player?

What happens if the entity is null?

  • Thanks 1
  • Quote

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 0
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Eridani
      Best way to create a new dye.

      By Eridani · Posted 5 minutes ago

      You've demystified this a little bit for me and pointed out a good note - if I want to duplicate existing items, since I have the source code I can technically copy and paste it into my own class to clone the complete logic. I'll see how that goes.    Thank you!
    • fckurshitsite
      "shaderpacks" folder does not appear in Minecraft folder!

      By fckurshitsite · Posted 46 minutes ago

      so rude and useless :^)
    • Silivek
      Mod won't load when in dev environment

      By Silivek · Posted 1 hour ago

      I ran it using the runClient configuration generated by  gradlew genEclipseRuns in the command line.
    • kiou.23
      Mod won't load when in dev environment

      By kiou.23 · Posted 1 hour ago

      That's odd, I couldn't find anything wrong with the code. could you describe exactly what steps you are taking to run the mod?   also: your group in build.gradle and your main path doesn't follow the convention, seeing that you have a github, you could use that http://maven.apache.org/guides/mini/guide-naming-conventions.html   EDIT: Ideally I would pull the repo to my machine and try running the mod myself, but my weak computer takes 4 hours to decompile mc, So... sorry I can't do that
    • cadbane86140
      The Dream Skin Invasion!

      By cadbane86140 · Posted 1 hour ago

      Hello There! This is a very weird but something worth documenting video on my channel, so late last night I see the usual stuff trending on twitter but decide to go into the server and well this happened... Our reactions are hilarious and I know you guys are gonna love it! I hope you all enjoy this video and if you did don't forget to like and sub for more!  
  • Topics

    • Eridani
      2
      Best way to create a new dye.

      By Eridani
      Started 23 hours ago

    • DenizAri
      6
      "shaderpacks" folder does not appear in Minecraft folder!

      By DenizAri
      Started January 24, 2020

    • Silivek
      6
      Mod won't load when in dev environment

      By Silivek
      Started Thursday at 05:46 PM

    • cadbane86140
      0
      The Dream Skin Invasion!

      By cadbane86140
      Started 1 hour ago

    • DeadZone
      4
      Crafting Damage (1.16)

      By DeadZone
      Started 3 hours ago

  • Who's Online (See full list)

    • Jubbie
    • usedneedlez
    • Eridani
    • Silivek
    • jbredwards
    • HoldenTheGamer
    • Godis_apan
    • MedHelm
    • joelpika
    • Jacogi 06
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.16.1]Block Properties
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community