diff --git a/patches/minecraft/net/minecraft/world/level/storage/loot/LootContext.java.patch b/patches/minecraft/net/minecraft/world/level/storage/loot/LootContext.java.patch index 15cd263cc2..357d390ce0 100644 --- a/patches/minecraft/net/minecraft/world/level/storage/loot/LootContext.java.patch +++ b/patches/minecraft/net/minecraft/world/level/storage/loot/LootContext.java.patch @@ -66,3 +66,15 @@ } } } +@@ -230,6 +_,11 @@ + + public LootContextParam m_79003_() { + return this.f_78995_; ++ } ++ ++ // Forge: This method is patched in to expose the same name used in getByName so that ContextNbtProvider#forEntity serializes it properly ++ public String getName() { ++ return this.f_78994_; + } + + public static LootContext.EntityTarget m_79006_(String p_79007_) { diff --git a/patches/minecraft/net/minecraft/world/level/storage/loot/providers/nbt/ContextNbtProvider.java.patch b/patches/minecraft/net/minecraft/world/level/storage/loot/providers/nbt/ContextNbtProvider.java.patch new file mode 100644 index 0000000000..be17438bd4 --- /dev/null +++ b/patches/minecraft/net/minecraft/world/level/storage/loot/providers/nbt/ContextNbtProvider.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/level/storage/loot/providers/nbt/ContextNbtProvider.java ++++ b/net/minecraft/world/level/storage/loot/providers/nbt/ContextNbtProvider.java +@@ -46,7 +_,7 @@ + } + + public String m_142016_() { +- return p_165578_.name(); ++ return p_165578_.getName(); + } + + public Set> m_142524_() {