Page 1 of 1

Was verwenden Sie anstelle von OnBlockActivated für Minecraft Forge 1.16.5?

Posted: 16 May 2025, 16:52
by Anonymous
Ich versuche, einen Block zu erstellen, der mich in eine neue Dimension sendet, aber wenn ich versuche, mit der rechten Maustaste darauf zu klicken, passiert nichts. Im Moment verwende ich: < /p>

Code: Select all

public ActionResultType onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) // Client-side: Only show a status message
if (worldIn.isRemote()) {
player.sendStatusMessage(new StringTextComponent("Client: Block activated!"), true);
return ActionResultType.SUCCESS;
}

// Server-side logic below
player.sendMessage(new StringTextComponent("blockActivated"), player.getUniqueID());
}
Ich erhalte eine Warnung "Überschreibt eine verwertete Methode in 'net.mincraft.block.abstractBlock'">