Jump to content

modders2

Members
  • Posts

    26
  • Joined

  • Last visited

Everything posted by modders2

  1. So I've attempted to create a BasicParticleType with deferred registries, I'll place all my code here as well as my latest.log! ParticleInit: public static final DeferredRegister<ParticleType<?>> PARTICLES = new DeferredRegister<>(ForgeRegistries.PARTICLE_TYPES, Reference.MODID); public static final RegistryObject<BasicParticleType> TEST_PARTICLE = PARTICLES.register("test_particle", () -> new BasicParticleType(false)); Main Class: ParticleList.PARTICLES.register(FMLJavaModLoadingContext.get().getModEventBus()); assets/testmod/particles/test_particle.json: { "textures": [ "testmod:test_particle" ] } The texture is located inside of assets/testmod/textures/particle/test_particle.png And my Latest.log is in this pastebin: https://pastebin.com/eVMuCPUf
  2. Hi, I looked on the docs about loot tables, however it seems that that section is gone now I'm guessing that maybe someone is updating them or just removing content that isn't very up to date. However, I was wondering how to add my item to a block's drop loot table (leaves). I am aware of the LootTableLoadEvent, however, I am unsure on how to use it
  3. Okay, so I've done this and I have the following: BrewingRecipeRegistry.addRecipe(Ingredient.fromStacks(PotionUtils.addPotionToItemStack(new ItemStack(Items.POTION), Potions.AWKWARD)), Ingredient.fromItems(ItemList.PEPPERS.get()), PotionUtils.addPotionToItemStack(new ItemStack(Items.POTION), PotionList.MORE_HEALTH_POTION.get())); Only problem with this, is that I can put one in, and it brews fine, however, putting more than one in will just keep brewing, it is accepting all potions, and overriding them if they aren't the output one
  4. Okay.... So I have BrewingRecipeRegistry.addRecipe(Ingredient.fromStacks(PotionUtils.addPotionToItemStack(here, Potions.AWKWARD))); But I'm not sure what to put for 'here' as it wants an ItemStack..
  5. Hi, I'm using a method to create a brewing recipe, and it is asking for Ingredient, all I can see from the Ingredient class is to get an item, however, I need to specify a paticular potion, how would I do this?
  6. I was wondering how to remove an item from a slot in my GUI. I currently have 2 slots, and I want to, when the user clicks a button in the GUI, to remove it from the slot and then place a different item into the second slot. I have the button setup like this currently in the Screen class: @Override protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { super.drawGuiContainerForegroundLayer(mouseX, mouseY); this.font.drawString(this.title.getFormattedText(), 51.0f, 6.0f, 4210752); this.font.drawString(this.playerInventory.getDisplayName().getFormattedText(), 8.0f, 112.0f, 4210752); this.addButton(new ImageButton(this.guiLeft + 77, this.guiTop + 24, 21, 20, 0, 208, 21, BACKGROUND_TEXTURE, (e) -> { System.out.println("Hello"); })); } And the PlayerInventory, along with the two slots are initialised inside of the Container class constructor here: this.addSlot(new Slot(tileEntity, 0, 16, 26)); this.addSlot(new Slot(tileEntity, 1, 52, 26));
  7. Okay, so I think I have what I need, what should I put for IPressable?
  8. So I currently have a GUI/Screen setup with a container and Tile Entity and I was wondering how to add a button to the Container GUI
  9. Is there a set way in which I should call my registries: Should I register items before blocks? Should I register Particles before Items? Should I register Tile Entities before Particles? I was wondering if there is a set way in which everything is registered
  10. So I've copied the vanilla particles, and I'm wondering which event I register them?
  11. Hello there, I was wondering how I could add a custom textured particle. Would it be better to use Deferred Registries or Registry Events? How would I setup the classes for the Particle?
  12. I've had a look, but where do they store the textures for them? I'm looking for the particle that comes from the end rod, but I can't find it
  13. Do you have an example I could look at maybe?
  14. Any help would be appreciated
  15. How do I create a custom particle in 1.15? I am using deferred registries - and I have this public static DeferredRegister<ParticleType<?>> PARTICLE = new DeferredRegister<>(ForgeRegistries.PARTICLE_TYPES, Main.MOD_ID); public static RegistryObject<ParticleType<?>> CARBON = PARTICLE.register("carbon", () -> new BasicParticleType(false)); However, I'm not sure what to do from here, if this is all I need or I need to add a directory to the actual texture file
  16. How would I be able to add my own painting to 1.15, I see after 1.12 the system has changed from a sprite sheet to individual textures. Wondering if this makes it easier to add paintings, however, I'm not sure how I would add one, any help is appreciated!
  17. Is anyone able to help with this?
  18. Hello there. I have created a fluid in the game (a kind of oil), I can control how fast and how far it flows, however I can't actually change the speed a player walks through it. When a player walks up to it they just walk through it as if it is air, any ideas on how I can fix this?
  19. Okay, I've got it now, thanks For anyone wondering what I did. In the setup method add this: ModBiomeFeatures.addPlainsBushes(Biomes.PLAINS);
  20. Is there a method I have to override in a specific class for me to be able to do this, if so what method in which class?
  21. Is there a way to add generation to vanilla biomes? I would like to add a generation type to a vanilla biome, Plains Bush, which specifically spawns in the plains biome. I have copied the code from the normal bush generation and it works in my custom biome, however, I would like to add it to the normal plains biome as it is where it needs to go.
  22. I managed to find out how to fix this
  23. I want to check if a slot in my GUI has been filled with a certain item. I'm not entirely sure how I'm supposed to check it though. Because in the Container class I have this.addSlotToContainer(new CarverSlot(barrelInventory, 0, 20, 25)); and I need to check that slot, but I'm not sure how
  24. I tried to set up a crop, just like the wheat, however when the block gets updated it breaks (when placed on farmland it breaks and turns the farmland to dirt). Actual Crop Class: public class CustomCropBlock extends CropsBlock implements IGrowable { public static final IntegerProperty CROP_AGE = BlockStateProperties.AGE_0_7; public CustomCropBlock(Properties builder) { super(builder); this.setDefaultState(this.stateContainer.getBaseState().with(this.getAgeProperty(), Integer.valueOf(0))); } @OnlyIn(Dist.CLIENT) protected IItemProvider getSeedsItem() { return ItemList.spinach_seeds; } @OnlyIn(Dist.CLIENT) public ItemStack getItem(IBlockReader worldIn, BlockPos pos, BlockState state) { return new ItemStack(this.getSeedsItem()); } @Override protected boolean isValidGround(BlockState state, IBlockReader worldIn, BlockPos pos) { return state.getBlock() instanceof FarmlandBlock; } @Override public IntegerProperty getAgeProperty() { return CROP_AGE; } @Override public int getMaxAge() { return 7; } @Override public boolean canGrow(IBlockReader worldIn, BlockPos pos, BlockState state, boolean isClient) { return !this.isMaxAge(state); } @Override public boolean canUseBonemeal(World worldIn, Random rand, BlockPos pos, BlockState state) { return true; } @Override public void grow(World worldIn, Random rand, BlockPos pos, BlockState state) { this.grow(worldIn, pos, state); } @Override protected void fillStateContainer(Builder<Block, BlockState> builder) { builder.add(CROP_AGE); } } Then the block gets registered in a method BlockList.spinach_crop = new CustomCropBlock(Properties.create(Material.LEAVES).doesNotBlockMovement().sound(SoundType.CROP).tickRandomly()).setRegistryName(location("spinach_crop"))
  25. I wanted to create a custom fire source, just like the one in vanilla, however there is always texture errors... I have tried extending BlockFire and just extending Block (then copying the necessary things into said class) But still - nothing.. Any help would be nice -
×
×
  • Create New...

Important Information

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