- 3
- 0
Я только начала изучать все по модам. Как создать блок под игроком. Написала, но код не работает. Может кто помочь и разъяснить, что поменять? Также буду рада любым источникам информации, где можно будет поизучать все по моддингу на 1.16
Java:
package com.foxyfine.my_test_mod.items;
import com.foxyfine.my_test_mod.TestMod;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.common.Tags;
import net.minecraftforge.event.entity.player.PlayerFlyableFallEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
@Mod.EventBusSubscriber(modid = TestMod.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.CLIENT)
public class TutEventHandler {
Vector3d playerPos;
@SubscribeEvent
public void event(PlayerFlyableFallEvent event) {
if (event.getPlayer() instanceof PlayerEntity) {
PlayerEntity player = event.getPlayer();
World world = player.getCommandSenderWorld();
int x = (int) player.getX();
int y = (int) player.getY();
int z = (int) player.getZ();
new BlockPos(x,y - 1,z);
Tags.Blocks.GLASS.isDefaulted();
}
}
}