Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Harry12OK

Members
  • Joined

  • Last visited

Posts posted by Harry12OK

  1. 4 minutes ago, diesieben07 said:

    You would have to disable all actions of your mod (e.g. creative tab filling, mob spawning, etc.) unless you detect the specific map.

    1 minute ago, diesieben07 said:

    I ... just described the workaround

    Ok my bad English isn't my first language. Ok so this was workaround 

    Can you elaborate how could I detect a specific map ?

  2. Guys it was a small mistake in blockstate file i was extering 'Y' instead of 'y' that was causing problem ,now it's fixed. but there is one more thing i want to ask.

    see this image:1948514703_bandicam2020-07-2516-21-09-747.jpg.6754b6dbe2bc1a070ca002c5b8e62d7f.jpg

    You can see my block is rotating as i have created a semicircle but the problem now is if i want to rotate the block in such a way that a full circle can be made with it in above image.

    is there any way to do it or is there any vanilla block with this behaviour so i can copy its block state file .

  3.  

    1 hour ago, poopoodice said:

    does it change every time you place it with different direction

    No, it doesnt change ,it is same no matter from wherever direction i place

     

    1 hour ago, poopoodice said:

    If yes, have you rotate its models according to its state in your blockstate file?

    I have specified it in blockstate file .here see it

    {
    	"variants":{
    		"facing=north": {"model": "hogwarts:block/half"},
    		"facing=south": { "model":"hogwarts:block/half", "Y" : 180},
    		"facing=west": { "model":"hogwarts:block/half", "Y" : 270},
    		"facing=east": { "model":"hogwarts:block/half", "Y" : 90}
    	}
    }

    Now i cant undertand what do you mean by debug screen ?

  4. Posted

    I created a custom model in blockbench and followed a tutorial on rotating the block to my face while placing but still it is not rotating to my face . My code is

    public class Half extends Block {
    	private static final DirectionProperty FACING = HorizontalBlock.HORIZONTAL_FACING;
    
    	private static final SoundType RS = SoundType.STONE;
    
    	public Half() {
             super(Block.Properties.create(Material.IRON).harvestTool(ToolType.PICKAXE).harvestLevel(2).lightValue(15).hardnessAndResistance(2.0f, 2.0f).sound(RS));
            
    	}
    	@Override
    	public BlockState getStateForPlacement(BlockItemUseContext context) {
    		
    		return this.getDefaultState().with(FACING, context.getPlacementHorizontalFacing().getOpposite());
    	}
    	@Override
    	public BlockState rotate(BlockState state, Rotation rot) {
    		
    		return state.with(FACING, rot.rotate(state.get(FACING)));
    	}
    	@Override
    	public BlockState mirror(BlockState state, Mirror mirrorIn) {
    		
    		return state.rotate(mirrorIn.toRotation(state.get(FACING)));
    	}
    	@Override
    	protected void fillStateContainer(Builder<Block, BlockState> builder) {
    		
    		builder.add(FACING);
    	}
    
    }

    any help to why is it not working ?

  5. 22 hours ago, poopoodice said:

    If you look into vanilla slabs, slab has one property (ignores water logged boolean property), and 3 possible types: top, bottom, and double which represents theirs states, but I think you should be able to use vanilla slab class instead of creating your own one.

    So i looked into vanilla slabs and did the same as vanilla ones and extended SlabBlock class and it worked .Thank you sir

  6. Posted

    Hey guys i created this texture which i dont know if looks like dirt or carpet.Give me some suggestions regarding if it looks like to you dirt or carpet?

     

     

                                                                                                                                   dirt.png.f135257c572cdaee02107d9f342b0275.png

     

  7. 11 minutes ago, diesieben07 said:

    Oh god why.

    Use proper variable names.

    I will fix it .Actually  my brain was cooked up. I did it for testing because i thought it would not work.

     

     

     

     

    and i mistakenly reported your comment by  seeing report post as reply to this post..

  8. ·

    Edited by Harry12OK

    thank You guys. I figured out and create my material. Bascially what i did was created a new class for my new material and implemented IItemTier and then did like the vanilla code.

    here is my code ===>

    public enum ToolMaterial implements IItemTier{
    	   
         RUBY(3, 1000, 5.0f, 9.0f, 10, () -> {
    		      return Ingredient.fromItems(ModItems.RUBY.get());
    	});
    
    	   private final int A;
    	   private final int B;
    	   private final float C;
    	   private final float D;
    	   private final int E;
    	   private final LazyValue<Ingredient> f;
    	 
    
    private ToolMaterial(int i, int j, float f, float g, int k, Supplier<Ingredient> object) {
    	  this.A = i;
          this.B = j;
          this.C = f;
          this.D = g;
          this.E = k;
          this.f = new LazyValue<>(object);
    }
    
    @Override
    public int getMaxUses() {
       
    	return this.B;
    	
    }
    
    @Override
    public float getEfficiency() {
    	return this.C;
    	
    }
    
    @Override
    public float getAttackDamage() {
    
    	return this.D;
    }
    
    @Override
    public int getHarvestLevel() {
    	
    	return this.A;
    }
    
    @Override
    public int getEnchantability() {
    
    	return this.E;
    }
    
    @Override
    public Ingredient getRepairMaterial() {
    
    	return this.f.getValue();
    }
    }

     

  9. ·

    Edited by Harry12OK

    On 4/28/2020 at 12:49 PM, DavidM said:

    Just pass an instance of IItemTier to your item.

    But IItemTier is an interface.It isn't a class.How am i supposed to pass an instance of it.I could only implement it.

     

    Sorry if i asked some foolish thing,i just have knowledge of basic core java.

  10. On 4/28/2020 at 12:08 PM, Fluorescent Flamingo said:

    You need to create your own class

    So isn't there any functionality like Enumhelper that would reduce the code.

    On 4/28/2020 at 12:21 PM, DavidM said:

    Note that if you are just looking to create one IItemTier implementation then there is no point in using an enum.

    So what should i do?

  11. Posted

    So basically i was creating some custom tools.Having been upgraded from 1.12.2 to 1.15.2;I can't really understand how to create your own tool material ,after some figuring out I got to know that it it IItemTier class that will create new tool material,but i cant really understand how that works,i also cannot find any hood tutorials or info on forge Documentation.Any help would be appreciated..

  12. Posted

    I have recently started modding a week ago.I created a block , named it RUBY  BLOCK.The class in eclipse is also named same.I wanted to drop two items from it.First the drop itself, and second  a custom item named ORB.I wnated to make the ORB item rare

    so i implemented the following method.

    I made a custom class RubyDrop for my drops and returned a NonNullList .

     

    public class RubyDrop  {
    
    	RubyDrop h = new RubyDrop();
    	Random random = new Random();
    
    	public NonNullList<ItemStack> dropped() {
    		NonNullList<ItemStack> drops = NonNullList.create();
    		int z = random.nextInt(1) + 10;
    		if (z < 9) {
    			drops.add(new ItemStack(ModBlocks.RUBY_BLOCK));
    		} else {
    
    			drops.add(new ItemStack(ModBlocks.RUBY_BLOCK));
    			drops.add(new ItemStack(ModItems.ORB));
    
    		}
    		return drops;
    	}
    
    }

     

    and after that in my getDrops method of my RubyBlock from which i want to drop these things i implemented as following===>

    @Override
    	public void getDrops(NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state,
    			int fortune) {
    		    RubyDrop k =  new RubyDrop();
    			super.getDrops(k.dropped(), world, pos, state, fortune);
    		}

     

    I thought the thing would be right.But now the block is not dropping even anything.I dont know what's wrong.Anyone figure me out .

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.