= 创作分享 =
崩溃解答
1.12.2Contenttweaker物品注册错误
Rhodium

1.12.2Contenttweaker物品注册错误

Rhodium 于 2020-11-15 08:32 ( 4年前 ) [复制链接] [只看楼主] [打印]
1496 1
100RF
脚本代码:#loader contenttweakerimport mods.contenttweaker.VanillaFactory;
import mods.contenttweaker.Item;
import mods.contenttweaker.IItemRightClick;
import mods.contenttweaker.Commands;
import mods.contenttweaker.Fluid;
import mods.contenttweaker.Color;
import mods.contenttweaker.MaterialSystem;
import mods.contenttweaker.Material;
import crafttweaker.entity.IEntityLivingBase;
import crafttweaker.entity.IEntity;
import crafttweaker.player.IPlayer;
import crafttweaker.events.IEventManager;
import crafttweaker.item.IItemStack;
import crafttweaker.item.IIngredient;

var book = VanillaFactory.createItem("book");
book.maxStackSize = 1;
book.creativeTab = <creativetab:misc>;
book.rarity = "epic";
book.glowing = true;

book.itemRightClick = function(stack, world, player, hand) {
if(player.offHandHeldItem == <item:bloodmagic:activation_crystal:2>) {
    Commands.call("summon minecraft:lightning_bolt", player, world);
    Commands.call("clear @p", player, world);
    Commands.call("give @p projecte:item.pe_tome", player, world);
    player.attackEntityFrom(<damageSource:OUT_OF_WORLD>, 1000000000000000.0f);
    } else {
    player.attackEntityFrom(<damageSource:OUT_OF_WORLD>, 1000000000000000.0f);
    }
    return "Pass";
};
book.register();

crafttweaker.log.txt (7.25 KB, 下载次数: 2)







最佳答案

查看完整内容

把 if(player.offHandHeldItem == ) 改成 if(player.offHandHeldItem has )
发表于 2020-11-15 08:32:45 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

回复 | 举报

该帖共收到 1 条回复!
ChromaPIE
把 if(player.offHandHeldItem == <item:bloodmagic:activation_crystal:2>)

改成 if(player.offHandHeldItem has <item:bloodmagic:activation_crystal:2>)
B* sit down, be humble.
发表于 2020-11-15 08:32:46 | 只看该作者

回复 | 举报

百科目前不允许匿名发帖哦~ 请先 [ 登陆 ][ 注册 ] 吧~

本版积分规则

发新帖
  • 回复
  • 点评
  • 评分

[ MC百科(mcmod.cn) 除另有声明,所有开放公共编辑的内容均使用 BY-NC-SA 3.0 协议 ]

Minecraft百科CC协议
快速回复 返回顶部 返回列表