I'm working on a function of fishing a loot chest.
import { $ItemFishedEvent } from "packages/net/minecraftforge/event/entity/player/$ItemFishedEvent"
import { $Blocks } from "packages/net/minecraft/world/level/block/$Blocks"
import { $Player } from "packages/net/minecraft/world/entity/player/$Player"
import { $FallingBlockEntity } from "packages/net/minecraft/world/entity/item/$FallingBlockEntity"
/**
*
* @param {$ItemFishedEvent} event
*/
global.fishingLoot = (event) => {
/** @type {$Player} */
const player = event.getEntity()
const hook = event.getHookEntity()
const level = player.getLevel()
if (!player.isPlayer()) return
console.log("Player is fishing")
const chestState = $Blocks.CHEST.defaultBlockState()
/**@type {$FallingBlockEntity} */
const lootChest = level.createEntity('minecraft:falling_block')
lootChest.blockState = chestState
lootChest.setPos(hook.getX(), hook.getY()+1, hook.getZ())
const dx = (player.getX() - hook.getX()) * 0.1
const dy = (player.getY() - hook.getY() + 1) * 0.1
const dz = (player.getZ() - hook.getZ()) * 0.1
lootChest.setMotion(dx, dy, dz)
lootChest.spawn()
event.setCanceled(true)
}
/**
*
* @param {$ItemFishedEvent} event
*/
export const handleFishingLoot = (event) => {
global.fishingLoot(event)
}
My codes can summon a chest and fly it to the player, but the render of falling blocks' animation is not available and I can't find the way of making the chests be loot chest. Is there any possible methods?

