跳转至内容

灵感大王

只要强加载所有区块就能获取到全部实体了。

11 主题 33 帖子
  • 一种基于AND/OR的单个方块状态使用多个模型

    1
    1 赞同
    1 帖子
    70 浏览
    yizhi9jiyan
    "apply"{"model":"texture_path"} 中model对应的value只能为字符串,且候选模型也只能选择一个模型,这个时候我们就可以使用{ "when":{"AND":[{}]},"apply":{} }来实现(或者把AND换成OR也行)单个方块状态添加第二个模型 示例 Github
  • [原创][KubeJS]利用事件监听制作弹幕武器

    kubejs
    7
    3 赞同
    7 帖子
    318 浏览
    不是客服M
    flowchart TD A((玩家空挥)) --> B{是否为特定武器} B -->|是| C["计算发射数据 发包服务端<br/>(坐标,弹幕实体id)"] B -->|不是| D["服务端生成相应弹幕"] C --> D D --> E((结束))
  • [原创][KubeJS]简单的以tick实现的嘲讽

    kubejs
    3
    2 赞同
    3 帖子
    86 浏览
    稽塔Gui_tarJ
    我必须先攻击拥有嘲讽的随从
  • [原创][KubeJS 6] 物品投射实现飞剑

    kubejs entityjs
    2
    3 赞同
    2 帖子
    110 浏览
    不是客服M
    cool
  • 养老向的物品抽奖机:虚空草莓

    kubejs 作物 forge
    2
    0 赞同
    2 帖子
    72 浏览
    忆然
    呜,硬编码名称
  • [原创][KubeJS][持续更新?]在kjs中使用createCustom进行注册物品

    kubejs
    1
    1 赞同
    1 帖子
    171 浏览
    忆然
    本文使用:CC-BY-NC-SA 4.0协议 kjs本身提供的物品注册比较有限,在注册某些kjs未提供的item的时候我们就需要用到createCustom 如果有需要的item注册可以在本文下方留言,会考虑更新 createCustom注册model是没有的,也就是你还得去写一份model.json(这部分可以参考原版wiki) 下面是使用createCustom去注册一个弓的例子 let $BowItem = Java.loadClass("net.minecraft.world.item.BowItem") let $Item$Properties = Java.loadClass("net.minecraft.world.item.Item$Properties") StartupEvents.registry("item", event => { event.createCustom("modid:item_name", () => { let properties = new $Item$Properties() //修改耐久 为0则无耐久属性 properties.durability(0) //修改最大堆叠数量 properties.stacksTo(1) //修改稀有度 properties.rarity("epic") //创建新的bowitem let item = new $BowItem(properties) //返回新的bowitem进行注册 return item }) })
  • [原创]使用kjs进行文件的删除

    kubejs 危险行为 数据操作
    4
    0 赞同
    4 帖子
    221 浏览
    草莓呜咩B
    @芒果凍布丁 我揣测Client可能被安全化了,所以loadClass,能直接用的话就安全多了呢。
  • 2 赞同
    2 帖子
    67 浏览
    半梦
    是幻梦吉斯,我们有救了
  • [1.20.1]强制加载并渲染特定区块

    渲染 forge
    5
    1 赞同
    5 帖子
    190 浏览
    忆然
    @Mafuyu 区块强制加载有用(点头
  • 美食再就业:用紫颂果慕斯进行定点传送

    kubejs 物品
    1
    3 赞同
    1 帖子
    50 浏览
    草莓呜咩B
    美食们可不止能饱腹而已! 紫颂果慕斯既然是紫颂果做的,就和传送脱不了关系? 现在可以将它在铁砧上改名为坐标,逗号间隔,吃了就可以传送到该坐标,是不是很方便呀。 不过还是要消耗一点点经验呢。 ItemEvents.foodEaten("kitchenkarrot:chorus_mousse", event => { let position = event.player.mainHandItem.displayName.getString().slice(1, -1).split(","); if (event.player.xpLevel < 3) event.player.statusMessage = "经验等级不足, 需要三级经验!"; else if (position.length == 3) { event.player.setPosition(position[0], position[1], position[2]); event.player.addXPLevels(-3); } }); 那么草莓慕斯会是什么效果呢?要是能召唤草莓军团就太帅了!
  • 1 赞同
    5 帖子
    200 浏览
    不是客服M
    翻了一下Forge原生的有这些 public static final RegistryObject<Codec<NoneBiomeModifier>> NONE_BIOME_MODIFIER_TYPE = BIOME_MODIFIER_SERIALIZERS.register("none", () -> Codec.unit(NoneBiomeModifier.INSTANCE)); /** * Stock biome modifier for adding features to biomes. */ public static final RegistryObject<Codec<AddFeaturesBiomeModifier>> ADD_FEATURES_BIOME_MODIFIER_TYPE = BIOME_MODIFIER_SERIALIZERS.register("add_features", () -> RecordCodecBuilder.create(builder -> builder.group( Biome.LIST_CODEC.fieldOf("biomes").forGetter(AddFeaturesBiomeModifier::biomes), PlacedFeature.LIST_CODEC.fieldOf("features").forGetter(AddFeaturesBiomeModifier::features), Decoration.CODEC.fieldOf("step").forGetter(AddFeaturesBiomeModifier::step) ).apply(builder, AddFeaturesBiomeModifier::new)) ); /** * Stock biome modifier for removing features from biomes. */ public static final RegistryObject<Codec<RemoveFeaturesBiomeModifier>> REMOVE_FEATURES_BIOME_MODIFIER_TYPE = BIOME_MODIFIER_SERIALIZERS.register("remove_features", () -> RecordCodecBuilder.create(builder -> builder.group( Biome.LIST_CODEC.fieldOf("biomes").forGetter(RemoveFeaturesBiomeModifier::biomes), PlacedFeature.LIST_CODEC.fieldOf("features").forGetter(RemoveFeaturesBiomeModifier::features), new ExtraCodecs.EitherCodec<List<Decoration>, Decoration>(Decoration.CODEC.listOf(), Decoration.CODEC).<Set<Decoration>>xmap( either -> either.map(Set::copyOf, Set::of), // convert list/singleton to set when decoding set -> set.size() == 1 ? Either.right(set.toArray(Decoration[]::new)[0]) : Either.left(List.copyOf(set)) ).optionalFieldOf("steps", EnumSet.allOf(Decoration.class)).forGetter(RemoveFeaturesBiomeModifier::steps) ).apply(builder, RemoveFeaturesBiomeModifier::new)) ); /** * Stock biome modifier for adding mob spawns to biomes. */ public static final RegistryObject<Codec<AddSpawnsBiomeModifier>> ADD_SPAWNS_BIOME_MODIFIER_TYPE = BIOME_MODIFIER_SERIALIZERS.register("add_spawns", () -> RecordCodecBuilder.create(builder -> builder.group( Biome.LIST_CODEC.fieldOf("biomes").forGetter(AddSpawnsBiomeModifier::biomes), // Allow either a list or single spawner, attempting to decode the list format first. // Uses the better EitherCodec that logs both errors if both formats fail to parse. new ExtraCodecs.EitherCodec<>(SpawnerData.CODEC.listOf(), SpawnerData.CODEC).xmap( either -> either.map(Function.identity(), List::of), // convert list/singleton to list when decoding list -> list.size() == 1 ? Either.right(list.get(0)) : Either.left(list) // convert list to singleton/list when encoding ).fieldOf("spawners").forGetter(AddSpawnsBiomeModifier::spawners) ).apply(builder, AddSpawnsBiomeModifier::new)) ); /** * Stock biome modifier for removing mob spawns from biomes. */ public static final RegistryObject<Codec<RemoveSpawnsBiomeModifier>> REMOVE_SPAWNS_BIOME_MODIFIER_TYPE = BIOME_MODIFIER_SERIALIZERS.register("remove_spawns", () -> RecordCodecBuilder.create(builder -> builder.group( Biome.LIST_CODEC.fieldOf("biomes").forGetter(RemoveSpawnsBiomeModifier::biomes), RegistryCodecs.homogeneousList(ForgeRegistries.Keys.ENTITY_TYPES).fieldOf("entity_types").forGetter(RemoveSpawnsBiomeModifier::entityTypes) ).apply(builder, RemoveSpawnsBiomeModifier::new)) );