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.

Vetihok

Members
  • Joined

  • Last visited

Everything posted by Vetihok

  1. Here is what I did . I don't know if it's correct and I don't know how to register it package com.vetihok.corruption.world.loot; import com.google.common.collect.ImmutableSet; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonObject; import com.google.gson.JsonSerializationContext; import net.minecraft.advancements.criterion.EntityPredicate; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityType; import net.minecraft.entity.passive.FoxEntity; import net.minecraft.util.ResourceLocation; import net.minecraft.world.storage.loot.LootContext; import net.minecraft.world.storage.loot.LootParameter; import net.minecraft.world.storage.loot.LootParameters; import net.minecraft.world.storage.loot.conditions.ILootCondition; import java.util.Set; public class SnowFoxCondition implements ILootCondition { private static final SnowFoxCondition INSTANCE = new SnowFoxCondition(); public SnowFoxCondition() { } public Set<LootParameter<?>> getRequiredParameters() { return ImmutableSet.of(LootParameters.THIS_ENTITY); } public boolean test(LootContext ctx) { Entity entity = ctx.get(LootParameters.THIS_ENTITY); if (entity.equals(EntityType.FOX)){ if (((FoxEntity)entity).getVariantType().equals(FoxEntity.Type.SNOW)){ return true; } } return false; } public static IBuilder builder() { return () -> { return new SnowFoxCondition(); }; } public static class Serializer extends AbstractSerializer<SnowFoxCondition> { protected Serializer() { super(new ResourceLocation("corruption", "snow_fox"), SnowFoxCondition.class); } public void serialize(JsonObject object, SnowFoxCondition p_186605_2_, JsonSerializationContext p_186605_3_) { } public SnowFoxCondition deserialize(JsonObject object, JsonDeserializationContext p_186603_2_) { return SnowFoxCondition.INSTANCE; } } }
  2. In both cases, with and without, foxes drop my item but red foxes too
  3. I replaced "fox_type": 1 by "type": "snow_fox" but I got this error: Unknown entity type 'minecraft: snow_fox' and it doesn't work with this too "predicate": { "type": "minecraft:fox", "nbt": "{Type:snow}" }
  4. Hi ! I tried to apply a loot table only for snow fox so i added an entity_properties condition { "pools": [ { "rolls": 1, "entries": [ { "type": "item", "name": "corruption:snow_fox_fur", "weight": 100, "functions": [ { "function": "set_count", "count": { "min": 1, "max": 2 }, "conditions": [ { "condition": "random_chance", "chance": 1 }, { "condition": "entity_properties", "entity": "this", "predicate": { "fox_type": 1 } } ] } ] }, { "type": "empty", "weight": 0 } ] } ] } but it didn't work. Can someone help me? Thank you

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.