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

Hey,

Because i couldn't find entry for loot tables in the 1.15.x documentation, so I tried to edit the drop from a sand block with the help from the 1.13.x documentation. But I ran in two problem.

 

After reading the article about editing vanilla loot tables my code looks like the following:

@SubscribeEvent
public void lootLoad(LootTableLoadEvent event) {
    if (event.getName().toString().equals("minecraft:blocks/sand")) {
        
	LootEntry entry = new LootEntryTable(new ResourceLocation("mymod:inject/sand"), 100, 100, 0, "sand_entry");

	LootPool pool = new LootPool(new LootEntry[] {entry}, 0, 1, 0, "sand_pool");

	event.getTable().addPool(pool);

    }
}

 

The following errors appear:

 

1. The documentation says, I need to create a new LootEntry with new LootEntryTable(), but there is not a Class LootEntryTable, which can be imported.

2. When trying to create the pool, the IDE says: 

                 private LootPool(@NotNull net.minecraft.world.storage.loot.LootEntry[] p_i51268_1_,
                 @NotNull net.minecraft.world.storage.loot.conditions.ILootCondition[] p_i51268_2_,
                 @NotNull net.minecraft.world.storage.loot.functions.ILootFunction[] p_i51268_3_,
                 net.minecraft.world.storage.loot.IRandomRange p_i51268_4_,
                 net.minecraft.world.storage.loot.RandomValueRange p_i51268_5_,
                 String name)

No plan what the IDE wants me to say. :(

 

Due to I haven't used Java in a while and switched from NetBeans to Intellij, I a noob in this area.

 

I appreciate every kind of help. :)

Edited by Koque

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.