Jump to content

Daniel Rollins

Members
  • Posts

    28
  • Joined

  • Last visited

Everything posted by Daniel Rollins

  1. I never did get an answer but I partially solved my issue when I upgraded to 1.16.2 since the new vanilla dimension system includes a tag for changing the sky type. I can't control exactly how much fog, or whether I can get stars without a sun, but I can get either an overworld sky, nether sky, or end sky. For my purposes, getting a nether sky got me most of what I wanted since it gave me a decent level of fog and took away the sun/stars/etc. I had another dimension where I wanted just the stars and so far haven't found a solution to that other than to set the time to midnight and ignore the sun below (I'm doing a space dimension so I can see in all directions).
  2. In my entity I made a function like this (you can name the function whatever you want since you are not overriding anything): public static AttributeModifierMap.MutableAttribute setCustomAttributes() { return MobEntity.func_233666_p_().func_233815_a_(Attributes.MOVEMENT_SPEED, (double)0.5F).func_233815_a_(Attributes.MAX_HEALTH, 20.0D).func_233815_a_(Attributes.ATTACK_DAMAGE, 5.0D); } In my main class in the setup function I had a deferredWorkQueue where I dealt with the function above like this: DeferredWorkQueue.runLater(() -> { GlobalEntityTypeAttributes.put(MyEntities.myCustomEntity, CrewmanEntity.setCustomAttributes().func_233813_a_()); }); Basically the GlobalEntityTypeAttributes.put function takes in your entity class and the function in your entity class the sets the attributes (make sure to add the .func_233813_a_() at the end of your function name).
  3. Hi, I am trying out the new custom dimension/dimension_type JSONs and have some custom biomes (in code, not the 1.16.2 snapshot JSONs). How do I change the sky? I see in the biome I can change the sky color and fog but I always have a sky (sun/moon/stars). I want to do something more like the end or the nether (no sun/moon/stars, and have a definite sky color in all directions with a heavy fog). In 1.15.2 I could override isSurfaceWorld() and return true to get a normal sky or false to get no sky. I could also return true on doesXZShowFog() to get fog in the distance and if I returned any value greater than 1 in getFogColor(), that RGB component would make a thick fog (the higher the value the thicker the fog). I can't seem to do any of that with the new JSON system. The only way I've found so far of getting rid of the sky is changing the dimension type to end or nether but then I get the preset for end/nether. Does anyone have any suggestions on how I can get rid of the sky and have a thick fog? Thank you ahead of time for your help.
  4. Nevermind. Recent forge update made FluidTags#makeWrapperTag() public so I can use that now.
  5. Hi, any more ideas? I can't seem to get that one to work. Maybe I'm doing it wrong. I get an error that the game is trying to use the value before it is bound.
  6. I see the makeWrapperTag function but it is private so I can't use it. If I use TagRegistry, I can't seem to get it to inject it into the already existing TagRegistry that FluidTags is using since I have no way of accessing that since it is private to FluidTags.
  7. I see the makeWrapperTag function but it is private so I can't use it. If I use TagRegistry, I can't seem to get it to inject it into the already existing TagRegistry that FluidTags is using since I have no way of accessing that since it is private to FluidTags.
  8. Hi, How do we set up FluidTags in 1.16.1? In 1.15.2 there was a Wrapper class within FluidTags and was able to do this: public static Tag<Fluid> MY_FLUID = new FluidTags.Wrapper(new ResourceLocation(Main.MODID, "my_fluid")); That subclass is gone now and I can't seem to find the new way to set up those tags. Thanks
  9. Hi, In 1.15.2 in our custom entity class you had a function called registerAttributes where you could set MAX_HEALTH, MOVEMENT_SPEED, ATTACK_DAMAGE, etc. Like this: @Override protected void registerAttributes() { super.registerAttributes(); this.getAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(20.0D); this.getAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.5D); this.getAttributes().registerAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(5.0D); this.getAttribute(SWIM_SPEED).setBaseValue(0.030D); } That seems to have gone away in 1.16.1. Looking at other entities, each one seems to have a function like this: public static AttributeModifierMap.MutableAttribute func_234300_m_() { return MobEntity.func_233666_p_().func_233815_a_(Attributes.field_233818_a_, 30.0D); } I have been able to determine which fields correspond to health, attack damage, etc. My problem is that i've found that the function name (func_234300_m_() in the example above) is different for each and every entity because they are all called from GlobalEntityTypeAttributes in a private variable that references each and every entity's unique function name instead of just having an inherited method that you can override. Does anyone know the new proper way to set attributes for custom entities in 1.16.1? I'm not looking to create my own attributes, just set things like MAX_HEALTH, etc. Thanks
  10. Thank you. I didn't realize it kept every possible combination mapped, that would be huge. I'm looking into the IDynamicBakedModel now. Do you happen to know where I can find any documentation on it? So far I'm just finding different people's code but not really much explanation (probably just looking in the wrong place).
  11. Hi, I have created a container object to store items. I am looking to make it kind of like a shelf in real life (think texture changing based off of what slots are filled to show the item in that part of the shelf). My container only accepts certain items so I can have a texture for the empty shelf, one for the full shelf and use a multipart blockstate JSON to overlay the filled items (basically overlay a part of the filled shelf onto the empty shelf corresponding to the location of the item). The way I am attempting it is to create several blockstates (slot0, slot1, slot2, ...slot17) as boolean values. The problem I run into is that the game hangs on startup if I include all of the blockstates, but works fine if I only have a few. Is there a max number of blockstates a block can have? Is there a better way to do what I am trying to do? Thanks
  12. Hi, I've been hearing a lot about Deferred Registries recently. Some people seem to say this is the new/better way to register everything and to change everything over to the new way. Other people seem to indicate that it is useful for some things and not others. Some people have mentioned certain things not working with deferred registries. Rather than go off of hearsay and people who probably don't know much about the subject, I'd like to hear from you all the truth about this. Is Deferred registries the new way, replacing the old? Should I be changing all my Registry Events to deferred registries? Or is this just a tool for certain use cases, and if so, what cases? Is there a doc somewhere about this? I did try looking for one but haven't found anything answering my questions. Thanks
  13. Hi, I am trying to make a custom sign but it isn't working. I'm not really trying to make a fully custom sign, I just want to have a new additional sign that uses a different texture but behaves the same as the regular signs. (I don't want to override the textures of the regular signs because I want them too). The 2 problems I have with my sign are: 1. No texture (not sure where the texture for signs is declared but blockstate and model jsons do not have them and I haven't been able to find them in code), 2. When placing the sign, it doesn't open the sign GUI. The way I coded it was as follows: Registered blocks: MyBlocks.metal_sign = new StandingSignBlock(Block.Properties.create(Material.WOOD).doesNotBlockMovement().hardnessAndResistance(1.0F).sound(SoundType.WOOD)).setRegistryName(location("metal_sign")), MyBlocks.metal_wall_sign = new WallSignBlock(Block.Properties.create(Material.WOOD).doesNotBlockMovement().hardnessAndResistance(1.0F).sound(SoundType.WOOD)).setRegistryName(location("metal_wall_sign")) Registered item: MyItems.metal_sign = new SignItem((new Item.Properties()).maxStackSize(16).group(ItemGroup.DECORATIONS), MyBlocks.metal_sign, MyBlocks.metal_wall_sign).setRegistryName(MyBlocks.metal_sign.getRegistryName()) Created blockstate json for metal_sign & metal_wall_sign, created model json for metal_sign (I did this exactly like how acacia signs, oak signs, etc are done), created model item json as well. I found the sign textures in textures/entities/signs and tried putting mine in the same folder (both under minecraft and under my mod's folder), but that didn't help. I get no errors in the debug log so I'm really confused why this isn't working. I did verify (using data get block) that my invisible sign does have a tile entity of the right type. Any help would be appreciated. Thanks
  14. Is there a place I could see the error? It didn't show up in the debug log.
  15. Never mind, I figured it out. That particular block doesn't have a FACING property, it has a HORIZONTAL_FACING property. Use the right one and the code works.
  16. Sorry, I should have been more clear. The game doesn't crash, the command dies midway through. I added logger commands and can tell that it stops functioning at the exact statement above. I also get "An unexpected error occurred trying to execute that command" in the chat window and in the log.
  17. Hi, I am trying to write a custom command that finds specific blocks (with certain blockstates) and replaces them with other blocks with specific blockstates. I tried capturing a blockstate like this: BlockState sourceblock = Blocks.RED_GLAZED_TERRACOTTA.getDefaultState().with(BlockStateProperties.FACING, Direction.NORTH); and it crashes. What am I doing wrong? BTW: If I do it without the ".with(BlockStateProperties.FACING, Direction.NORTH)" part it works but then I can't get a specific blockstate. I don't want to replace all of a particular block, just all of a particular blockstate, like all red_glazed_terracotta[facing=north]. I also need to make sure I can build a similar blockstate for the destination block to replace with. In 1.12.2 I did it like this: BlockState sourceblock = convertArgToBlockState(Blocks.RED_GLAZED_TERRACOTTA, "0") The reason I want a blockstate is that I can do world.getBlockState(tempBlockPos) followed by a if check then a world.setBlockState(tempBlockPos, replaceItem.newBlockState, 2); Am I doing something wrong with my BlockState? Is there a better way to do this (without resorting to typing in the fill command)? Thank you for any help.
  18. Hi, I have a GUI that extends Screen. It is similar to how a writable_book works. There is not a container and no tileentity. The Gui pulls data from NBT from the Item and uses a network handler to send the data to the server. The Gui comes up from an Item by using onItemRightClick. I currently call it from that function like this: Minecraft.getInstance().displayGuiScreen(new MyGuiScreen(playerIn, itemstack, handIn)); That has been working fine until I put my mod on a Dedicated Server and got this error at startup: "Attempted to load class net/minecraft/client/gui/screen/Screen for invalid dist DEDICATED_SERVER". How do I call my Gui properly in 1.14.4 so it doesn't crash the server? I saw some posts that suggested other things like NetworkHooks but those all seemed to require tile entities or containers. Thank you for your help.
  19. Thank you everyone for your help. One more question: Is it possible to edit the actual Minecraft base code? It seems to be read-only in Eclipse. I found the part of the code where it does the block renames using the data fixer upper. If I could just add several additional lines of code to the function I think I could have it take care of my blocks as well. It seems like such a simple fix if I could just edit it, otherwise I'm not sure how to do it.
  20. So basically at the moment we can't bring over a modded world from 1.12.2 to 1.13 or 1.14? All we can do it get our mod ready for the new version and build everything in the world from scratch or wait for the new DataFixer system? What about that missingMapping thing. Would that help?
  21. Hi, I hope someone can point me in the right direction. I built a mod in 1.12.2 with lots of custom blocks which I used to build things in the world. I now have the mod working in 1.14.4 (and even in 1.13.2 along the way). The problem is that when I load one of my 1.12.2 worlds in 1.13.2 or in 1.14.4, all my custom blocks are gone from the world. I have them in the inventory so I can use them and I kept all the same names, but all my stuff only has the vanilla blocks. The custom blocks are just gone from anything I built. Is there something I'm missing? I figured keeping the block names the same would have converted them to the new version. Is there something else I need to do? Note: Some of the blocks are really simple, some have a few properties like powered and direction, and a few have tile entities. Thank you for any help you can give.
  22. Hi, I am making a custom command that included an EntityArgument but I don't want to actually parse that argument into entities. My custom command is like a custom teleport command that figures out the destination and then calls the real teleport command with the same source EntityArgument and the destination that my command figures out. I don't to just grab a string because I won't have the suggestions and validation that I normally get when using EntityArgument but I can't pass the parsed entities to the real teleport command as far as I know. Is there something I'm missing here? How can I get the raw string that was typed into the EntityArgument rather than the parsed version, or is there a better way to do this? In 1.12.2 I just kept that particular argument and passed it to the teleport command along with my generated destination. Thanks
×
×
  • Create New...

Important Information

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