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.

Featured Replies

Posted

I'm trying to make wither bosses drop this item (ModItems.ELUCIDATOR) and its not working. What am I doing wrong?

 

@SubscribeEvent
public void loadLootTables(LootTableLoadEvent event) {
	if (event.getName().toString().equals("minecraft:entities/wither")) {
		LootFunction[] funcs = {};
		LootCondition[] conds = {};
		LootEntry[] loots = {
				new LootEntryItem(ModItems.ELUCIDATOR, 99999, 7, funcs, conds, "elucidator") //just using 99999 as a test weight to make sure its actually working and I'm not really unlucky
			};
		LootPool pool = new LootPool(loots, conds, new RandomValueRange(1, 1), new RandomValueRange(0), "saomodpool");
		event.getTable().addPool(pool);
	}
}

 

24 minutes ago, TheGoldenProof said:

//just using 99999 as a test weight to make sure its actually working and I'm not really unlucky

If your entry is the only one then the weight does not matter.

 

If you want to add new drops to the pool use json, there is no need to do it from code. Read the official docs on the matter.

  • Author
2 minutes ago, V0idWa1k3r said:

If you want to add new drops to the pool use json

I have 0 understanding of json so I'm trying to avoid it as much as possible. Is there any way I could do it without?

4 minutes ago, TheGoldenProof said:

I have 0 understanding of json so I'm trying to avoid it as much as possible.

You need to rethink your approach. If you don't understand something you need to learn it, not avoid it like a plague. Minecraft is getting more and more data driven and utilizes json for more and more of it's things. If you wish to continue modding you need to learn to use json. It's not very difficult. You've learned to use java after all, that's way more difficult than some json.

JSON stands for JavaScript Object Notation, it’s just a serialised representation of an object. As voidwalker said, learnig java is a lot harder and you’ve already done it.

Edited by Cadiboo

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

try this:

        @SubscribeEvent
		public void mobDrop(LootTableLoadEvent event) {
	    
	    if (event.getName().equals(LootTableList.ENTITIES_WITHER)) {
		   	 
	        final LootPool main = event.getTable().getPool("main");
	 
	        if (main != null) {
	 
	        	main.addEntry(entry);
	            
	        }
	    }
	    
	  }

 

Edited by nov4e

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

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.