本帖最后由 数据system 于 2019-9-13 20:21 编辑
复制代码
为什么这样写会提示构造函数 AxisAlignedBB(double, double, double, double, double, double)不可视?
为什么这样写会提示构造函数 AxisAlignedBB(double, double, double, double, double, double)不可视?
- @SideOnly(Side.CLIENT)
- @SubscribeEvent
- public void onKeyInput(InputEvent.KeyInputEvent event)
- {
- if (KeyLoader.V.isPressed())
- {
- EntityPlayer player = Minecraft.getMinecraft().thePlayer;
- World world = Minecraft.getMinecraft().theWorld;
- ItemStack item =player.getHeldItem();
- if(item!=null)
- {
- if (!(item.getTagCompound()==null))
- {
- if(item.getTagCompound().getIntArray("Data") != null)
- {
- int[] i=item.getTagCompound().getIntArray("Data");
- double x=player.posX;double y=player.posY;double z=player.posZ;
- world.getEntitiesWithinAABB(EntityLiving.class,new AxisAlignedBB(-10, -10, -10, 10, 10, 10).offset(x,y,z));
- }
- }
- }
- }
- }
- }
为什么这样写会提示构造函数 AxisAlignedBB(double, double, double, double, double, double)不可视?
2021.12 数据,可能有更多内容
本帖最后由 数据system 于 2019-9-13 20:21 编辑代码:
- @SideOnly(Side.CLIENT)
- @SubscribeEvent
- public void onKeyInput(InputEvent.KeyInputEvent event)
- {
- if (KeyLoader.V.isPressed())
- {
- EntityPlayer player = Minecraft.getMinecraft().thePlayer;
- World world = Minecraft.getMinecraft().theWorld;
- ItemStack item =player.getHeldItem();
- if(item!=null)
- {
- if (!(item.getTagCompound()==null))
- {
- if(item.getTagCompound().getIntArray("Data") != null)
- {
- int[] i=item.getTagCompound().getIntArray("Data");
- double x=player.posX;double y=player.posY;double z=player.posZ;
- world.getEntitiesWithinAABB(EntityLiving.class,new AxisAlignedBB(-10, -10, -10, 10, 10, 10).offset(x,y,z));
- }
- }
- }
- }
- }
- }
为什么这样写会提示构造函数 AxisAlignedBB(double, double, double, double, double, double)不可视?
world.getEntitiesWithinAABB(EntityLiving.class,new AxisAlignedBB(-10, -10, -10, 10, 10, 10).offset(x,y,z));
如果不是你在编辑的时候打错,那就是你这行代码里有个中文括号。
如果不是你在编辑的时候打错,那就是你这行代码里有个中文括号。
森林蝙蝠 发表于 2019-9-13 16:35
world.getEntitiesWithinAABB(EntityLiving.class,new AxisAlignedBB(-10, -10, -10, 10, 10, 10).offset( ...
括号应该是编辑时打错了,不是括号的问题
数据system 发表于 2019-9-13 20:20
括号应该是编辑时打错了,不是括号的问题
那么什么是“构造函数不可视”呢,能不能截个图来?
森林蝙蝠 发表于 2019-9-13 20:57
那么什么是“构造函数不可视”呢,能不能截个图来?
或者大佬我想请问一下1.7.10版本除了用world.getEntitiesWithinAABB(EntityLiving.class,new AxisAlignedBB(-10, -10, -10, 10, 10, 10).offset(x,y,z));这个方法来获取周围实体,还有别的方法来获取吗?
数据system 发表于 2019-9-13 21:07
就是这样(电脑截图按下Ctrl这条提示就没了,只好用手机截图)
printscreen也能截图,我建议你跳转到那个类,看看构造器是不是public的。