Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Dizzylizard22

Members
  • Posts

    7
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Dizzylizard22's Achievements

Tree Puncher

Tree Puncher (2/8)

1

Reputation

  1. @TheRedWaffle I attempted using your suggestions. I believe I was able to initialize my property. Now lets say I want to decrement the value every time I click the block. Here is what I have so far. public class ExampleBlock extends Block { private IProperty<Integer> property = IntegerProperty.create("life",0,3); public ExampleBlock() { super(Block.Properties.create(Material.GLASS).harvestTool(ToolType.AXE).harvestLevel(0).hardnessAndResistance(0.5f, 20.0f).lightValue(16).sound(SoundType.GLASS)); this.setRegistryName("dlm", "example_block"); } @Override protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) { builder.add(property); } @Nullable @Override public BlockState getStateForPlacement(BlockItemUseContext context) { return this.getDefaultState().with(property,3); } @Override public void onBlockClicked(BlockState state, World worldIn, BlockPos pos, PlayerEntity player) { state.get(property) // How would I decrement this value? } } Also, I do not see any mention to this class or see any documentation online. Not sure how I could implement interactWith without that information. @QuantumSoul I went ahead and updated to the lasted mdk. After poking around a bit, I found that onBlockActivated is not in the Block class. I can only find it in the BlockState class. Not sure how I could override it without making an entirely new BlockState
  2. Hey everyone! I am still just starting to develop on Minecraft and maybe its my inexperience, but the forge documentation feels like it has no reference links or additional documentation to help me understand what I am actually using. So I read up on Forge's BlockState information page and wanted to just create a basic custom block that had an addition property. The property I created is an integer that ranges from 0-3. What I want to happen is that every time I place a block, this property (named "life") is initiated to the value 3. Then, every time I right click the block this value is decremented until it hits 0 and is destroyed. Here is what I have in the block class so far. public class ExampleBlock extends Block { private IProperty<Integer> property = IntegerProperty.create("life",0,3); public ExampleBlock() { super(Block.Properties.create(Material.GLASS).harvestTool(ToolType.AXE).harvestLevel(0).hardnessAndResistance(0.5f, 20.0f).lightValue(16).sound(SoundType.GLASS)); this.setRegistryName("dlm", "example_block"); } @Override protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) { builder.add(property); } } So I have having a couple issues with this... 1. I can not figure out where I can initialize that "life" property to the value 3. 2. All functions like "onBlockClicked" or "func_225533_a" (I guess this is my onBlockActivated??? To be honest I see no mention of that function anywhere in the block class) are deprecated. I heard this is done because these functions are supposed to be called in BlockState but creating my own custom BlockState has become a nightmare since I do not know how to properly create a ImmutableMap and I have no clue how to use a collection apparently. My basic idea was to steal the already created BlockState from this block and just pass in the new property into my own new BlockState. But when writing my own BlockState class I realized I can't access a property that the state has no mention of. Can anyone help me figure out how to property add functionality to my new block? Thank you!
  3. This was resolved by installing Java 9. Hope this helps.
  4. Yes!! I have always had trouble just setting up my enviornment for modding. Finally happy to have it launch at least! Also, I would just go with making an Oracle account instead of looking for some sketch download link.
  5. Installing Java 9 was successful! hope this works for you pal!
  6. I am having the same issue. Looking online everyone says that it is because we have compiled with the wrong version of java. But, after looking at java documentation the method rewind for bytebuffer is included in Java 9. I thought we needed Java 8 for minecraft? Not sure, but I will be installing Java 9 and trying it and I will come back with results.
  7. Hey everyone, I have always wanted to start modding minecraft but never gotten past the point of setting up an enviornment. Typically, I would try it on my desktop which is windows but right now I am using my macbook. I am using eclipse and I am attempting to mod on the latest version on minecraft 1.15.2 and I have downloaded the latest version of forge mdk. I have gone over the read me instructions multiple times I have even fully uninstalled and reinstalled java on my mac twice. Currently, from what I can tell, I am using Java 8 as its required, the version given by command prompt is 1.8.0_251 (using java -version). I have even set my java_home to point to this version of java and it was successful. When I get to the point of actually building and running the example mod provided by forge I get a NoSuchMethodError for the method rewind in ByteBuffer. I will post the whole log below but everything online says that this is because the code is compiling on a Java version later than Java 8. I have no idea how this is possible if I do not even have any other Java version on my mac. Can someone please explain to me how I could build a project on a java version that I dont even have installed? I apologize for coming here with such a basic set up question, even though it has been asked many times before on the internet. But I assure you I have followed all the tutorials I can find and many are out of date. Also, I feel like all of the forum posts I saw that said it was compiling on the wrong version never explained how to change this. I went into builder and changed the path before and just ran into more problems. I also went into compiler and pointed it to my javac for 1.8.0 and it was failing to compile due to missing variables or something. Any help would be appreciated, I just want to start messing around with minecraft modding already. Thanks! **EDIT: Also, I am on macOS Catalina v 10.15.4 But I do not think that is the reason it is failing. Here is the crash log..
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.