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


  • Posts

  • Joined

  • Last visited

Everything posted by FireTamer81

  1. Basically just the title My current idea is that I can use the "getDrops" method like in the ShulkerBoxBlock class and apply a "item tag" with the data, but I am not sure if an "item tag" is even a thing nor how to properly use the "getDrops" method (do I retain the loot table for the block). Is there another mod that does something like this that isn't related to container items like shulker boxes, just some type of data? If so a link to it would be the only help I need. If not, then would someone mind explaining how this might be done?
  2. After testing around, any of the previous ways I were doing it would have worked had I just put that one thing in value changing methods... dang
  3. Okay, I got it to work, but only because I found a tutorial for 1.11.2 that had markDirty(); on methods that changed the given values which I then tracked to .setChanged(); in the current version.
  4. Okay, non of the methods or fields are static now. I put the default value in the constructor: public StrongBlockTileEntity(TileEntityType<?> tileEntityType) { super(tileEntityType); this.strongBlockHealth = 3000; } But now it doesn't change when I use the Dev Tool on it. I also changed this part maybe an hour ago because I realized it was stupid. (I think the reason it was stupid was because I was supplying the class extending TileEntity instead of the TileEntityType RegistryObject, but not sure) StrongBlockTileEntity strongBlockTile = new StrongBlockTileEntity();
  5. With what I have above, the value does change and stays at the changed value until the world is unloaded. (If I use the Dev Item I made for damaging it 3 times to get to 2700 it will stay there) Just doesn't save NBT wise
  6. I am currently taking Java Classes with my highschool, so I still a little weak on remembering those things. However, I had it static because the "setInitialBlockHealth()" method cannot be referenced when it isn't static by my "onPlace" method in my block class, so then I have to change all the other methods and the "strongBlockHealth" field to static to match. But that then causes the problem above. The value also doesn't change at all when the field and methods are not static.
  7. My goal with this is to have a block with a "Health Value" to both determine whether it should break and it's current model. I currently have that value being set to 3000 when the block is placed down. I don't understand why, but after mimicking both vanilla and other mod examples of saving NBT data in a TileEntity, mine just won't save. I have gotten the actual value/data to work since I can use the "/data get block" command on it, but it always resets to 0 when I close and reload the world. This is my Block Class: public class WarenaiBlock extends Block { public static final IntegerProperty CRACKED_DIRTY_CLEAN_POLISHED = CustomBlockstateProperties.CRACKED_DIRTY_CLEAN_POLISHED; public WarenaiBlock(Properties properties) { super(properties); this.registerDefaultState(this.stateDefinition.any() .setValue(CRACKED_DIRTY_CLEAN_POLISHED, Integer.valueOf(3))); } protected void createBlockStateDefinition(StateContainer.Builder<Block, BlockState> stateBuilder) { stateBuilder.add(CRACKED_DIRTY_CLEAN_POLISHED); } public void onPlace(BlockState p_220082_1_, World p_220082_2_, BlockPos p_220082_3_, BlockState p_220082_4_, boolean p_220082_5_) { StrongBlockTileEntity.setInitialBlockHealth(); } @Override public boolean hasTileEntity(BlockState state) { return true; } @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { return new StrongBlockTileEntity(); } This is my TileEntity class: public class StrongBlockTileEntity extends TileEntity { private static int strongBlockHealth; public StrongBlockTileEntity(TileEntityType<?> tileEntityType) { super(tileEntityType); } public StrongBlockTileEntity() { this(TileEntityTypesInit.WARENAI_BLOCK_BLACK_STRONGBLOCK_TILE.get()); } public static void damageStrongBlock(int damageAmount) { int currentBlockHealth = strongBlockHealth; strongBlockHealth = currentBlockHealth - damageAmount; } public void repairStrongBlock(int repairAmount) { int currentBlockHealth = strongBlockHealth; strongBlockHealth = currentBlockHealth + repairAmount; } public static int getStrongBlockHealth() { return strongBlockHealth; } public static void showBlockHealth() { System.out.println("Block Health is: " + getStrongBlockHealth()); } public static void setInitialBlockHealth() { strongBlockHealth = 3000; } /** * Overrides */ @Override public CompoundNBT save(CompoundNBT tags) { super.save(tags); tags.putInt("BlockHealth", this.strongBlockHealth); return tags; } @Override public void load(BlockState state, CompoundNBT tags) { super.load(state, tags); strongBlockHealth = tags.getInt("BlockHealth"); } } I also have two "Development Tools" that I made to manipulate the BlockHealth Value which do work: public class DamageItem extends Item { public DamageItem(Properties properties) { super(properties); } @Override public ActionResultType useOn(ItemUseContext context) { World worldIn = context.getLevel(); BlockPos blockPos = context.getClickedPos(); BlockState blockState = worldIn.getBlockState(blockPos); //Block warenaiClassBlock = blockState.getBlock(); boolean warenaiClassBlock = blockState.getBlock() instanceof WarenaiBlock; if (blockState.hasTileEntity() && warenaiClassBlock) { StrongBlockTileEntity strongBlockTile = new StrongBlockTileEntity(); strongBlockTile.damageStrongBlock(50); //strongBlockTile.showBlockHealth(); return ActionResultType.SUCCESS; } else { return ActionResultType.PASS; } } }
  8. Okay, that's what I thought. So now I just need to figure out how to do the health within the tile entity, and then make it persist even when broken using NBT. I do have one question though: The idea is that this will be a general building block (semi-hard to craft though), so will each of the blocks having a tile entity and all of this stuff affect performance a notable amount, or not because it is fairly simple?
  9. As the name implies I am trying to make a block with a "condition" value. I am doing this because I will be adding future features where a very strong type of block would be useful. I have started out with making a simple custom blockstate property (1-4) which determines the model (Polished, Un-polished, scuffed, cracked). However, I want those 4 states to then be determined by a larger number (more wiggle room with how much damage a certain event can do to this type of block). I was thinking 3000-5000, which I can then say "oh the block durability has to be at 200 to be cracked, but 750 for scuffed". I think the large health number think could be done with a tile entity I also want certain states to be maintained even after it has been picked up such as the larger number (maybe not the 1-4 since I think I would have to do something funky with datagen for my 90 items to have 360 item models), so perhaps NBT (which I have never done before). ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ I could probably figure this out on my own given a good bit of time, but dual-enrollment does not allow much time in a day. So, basically just looking either for a github repos that shows persistent data & some funky tile entities (if that is the best route for the block health thing), or suggestions.
  10. While chugging along making the JSONs by hand (to get an idea of how they need to be generated for each type of block), I cam up with a possibly brilliant idea. Could I somehow make template JSONs and when a new block of a certain type is being generated it will just pull the template and replace certain keywords like "NAME" and "COLOR" instead of all of this getVariantBuilder stuff
  11. I am not sure whether this will help you since I have it in 1.16, but this is the repo for my testing mod for a branch where I made a custom fluid (that uses a grayscale texture and assigns color dynamically). Perhaps it can at least help a little bit. Good luck mate! https://github.com/FireTamer81/1.16.5-Testing-Mod/tree/Custom-Colorable-Fluid
  12. So, I am rewriting my mod in an effort to do it MUCH better. I don't want to have to deal with copying, pasting, and editing 5,280 JSON files (yes I counted), so I am working on datagen. I Want to add the features I was saying "ah, I'll do it later" to, so I am doing them. Etc........ Well, right now I am making a type of block with a custom blockstate property (an integer value of 1-4), which will make it change it's model. I have that done and have it working... with handwritten JSONS. Now I am wanting to do it in datagen since I will be making I think 48 actual full blocks, which would need 288 JSON files. Which I would then be doing something similar for Stair, Slab, Fence, and Wall variants. So basically, I really need to do it datagen, just don't know how. Would any of you folk have suggestions or perhaps github repos that show datagen with custom blockstate properties, or perhaps even just how to use the "getVariantBuilder" thing since I will be doing the whole custom blockstate property to stairs, fences, and walls as well.
  13. Oh boy, that seem complicated.... oh well. Never learn how to do it if I don't try. Would you perhaps know of a couple mods that do either something similar to what I am trying to doing or just make their own ChunkGenerator & NoiseGenerator I could look at on github? Also, thank you for the help mate!
  14. Not sure about custom chunk generators (I haven't done much super complex stuff yet, but working on it). For a time I did try making separate biomes with radical heights and asking them dot around, but I could never get them small enough the normal way through the jsons. What would a custom chunk generator entail?
  15. I remember someone saying something about "Noise Deformation" when I was trying to do a thing with my custom dimension. Not sure how it works or where I would start, I just went with making a making a couple structures and having them placed in the dimension that look somewhat like the spires in this image: Even though I had my quarrels with it such as having a layer of dirt underneath them, and repetitiveness among others, I just wanted to get done with the dimension for a bit of time. Now, I am wanting to polish some stuff a bit and want to understand what replacing the whole structure thing with "noise deformation" would entail. Is it worth the effort, how much effort, is there a lot of math involved, etc.
  16. It worked............... IT WORKED!!!!!!!!!!!!!! I could kiss you!!!!!! Thank you so much mate!
  17. Nope, didn't work. I updated the repos just so it can be seen in it's current state
  18. Well, I had tried "NotANumber" a few times, and I even did it in enqueueWork a few of my attempts. I'll try it again though
  19. Now, I have tried many things to get it to work, including the advice I was given in my original post After I couldn't get that to work I looked through Github and found TropiCraft, which literally changes cloud height (It even says it in their Access Transformer File). https://github.com/Tropicraft/Tropicraft/blob/1.16/src/main/resources/META-INF/accesstransformer.cfg But Still, it doesn't work. Yes, I tried doing it myself and understanding what I was actually writing in code, but then after much frustration I just carbon copied from TropiCraft. I just don't know what I am doing wrong, especially since I ended up practically copying from TropiCraft which does the whole cloud thing successfully. Here's my mod repository if anyone wants to take a look, I'm going on vacation (figuratively) https://github.com/FireTamer81/1.16.5-DragonBlockCore/tree/main These are the files related to the problem: DBCoreMain ClientStuff world/dimensionStuff/DBDimensions time_chamber_dimension.json time_chamber_biome.json time_chamber_surface_builder.json resources/META-INF/accesstransformer.cfg
  20. I will not use an excuse for this, but I didn't quite understand. I don't want to ask for a step-by-step or anything, would you just perhaps be able to provide a github repos that shows something like this in action? Perhaps just Dimension Effects in general and I can figure out from there.
  21. Right now I was testing with a super flat overworld, but once I get this working I will add it to my own dimension instead. Anyone know what's supposed to be done here? P.S. I am using 1.16
  22. Goal: I am wanting to create a dimension that is like a white void. If you have seen Dragonball Z, then think of the Time Chamber. If not, then look at the image below. However, I am wanting to add something special to this dimension. I remember reading in a fan manga with a topic of something about the center/edge of the time chamber (it was some real funky non-Euclidian space thing). I want to add that. So, I basically want to control the placement of say 3 biomes based on distance from 0, 0. Each one getting more and more "broken" the further out it is, and once the player gets so far out they will be sent to another dimension in relation to that fan manga. If for some reason this is not possible I might be able to do something like making a separate dimension for each section based on the player position as well. I might actually have to do that if I can't figure out how to make a biome completely flat, cause then I would have to use a superflat generation thingy which only takes one biome. I guess that's a bonus question. I have made another (more normal) dimension before and understand the json stuff semi-okay, so explanation on that stuff probably won't be required.
  23. Basically, I already have 5 Biomes that I have made that work without errors, have custom features, etc. Up until now I have been using single biome worlds to view/tweak said biomes, but the ultimate goal was to get them into their own dimension. Now, I know I could just transfer the biomes over to Json and be done with it all, but I would rather keep everything but the dimension and things like structures as code. My reasons, the Json method seems less intuitive (much more difficult to tell when something has been done wrong) and I have special things in place such as with my custom surface builder that I would have to reference in the biome jsons anyways (No reason not to just reference the biomes in the dimension json at that point). So, is there a way to use the coded biomes in my json dimension. I am willing to use "hacky" methods just so long as errors and lag don't become a problem somehow (to be honest, the last time I tried making json biomes I ended up wiht this weird "invalid biome id" error that lagged the world to death that I just couldn't figure out).
  • Create New...

Important Information

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