manifest.json
文件格式
{
"Name": "<your project name>",
"Author": "<your name>",
"Version": "1.0.0",
"Description": "<One or two sentences about the mod>",
"UniqueID": "<your name>.<your project name>",
"EntryDll": "<your project name>.dll",
"MinimumApiVersion": "2.10.0",
"UpdateKeys": []
}
继承父类Mod
添加一个事件
using StardewModdingAPI;
using StardewModdingAPI.Events;
namespace NewMod
{
public class NewMod : Mod
{
public override void Entry(IModHelper helper)
{
helper.Events.Input.ButtonPressed += onButtonPressed;
}
private void onButtonPressed(object sender, ButtonPressedEventArgs e)
{
//如果世界没有完成返回
if(!Context.IsWorldReady)
return;
//输出玩家按下的某个键
Monitor.Log(e.Button.ToString(),LogLevel.Debug);
}
}
}
这样一个mod就完成了