Skip to content

Instantly share code, notes, and snippets.

View NiclasOlofsson's full-sized avatar

Niclas Olofsson NiclasOlofsson

View GitHub Profile
MetadataDictionary metadata = new MetadataDictionary();
metadata[0] = new MetadataLong(105553116807168); // 11000000000000000000000000010000100000000000000; ShowName, CanClimb, HasCollision, AffectedByGravity14, 19, 45, 46,
metadata[1] = new MetadataInt(1);
metadata[2] = new MetadataInt(0);
metadata[3] = new MetadataByte(0);
metadata[4] = new MetadataString("jeb_");
metadata[5] = new MetadataLong(-1);
metadata[7] = new MetadataShort(300);
metadata[8] = new MetadataInt(0);
metadata[9] = new MetadataByte(0);
public class ActionHealthManager : HealthManager
{
private readonly Action<Entity> _action;
public ActionHealthManager(Entity entity, Action<Entity> action) : base(entity)
{
_action = action;
}
public override void TakeHit(Entity source, int damage = 1, DamageCause cause = DamageCause.Unknown)
#DO NOT REMOVE THIS LINE - MiNET Config
#ip=0.0.0.0
#port=19134
# Throttling
MaxNumberOfPlayers=10000
#MaxNumberOfConcurrentConnects=1
#InactivityTimeout=2000
#UseEncryption=false
"gamerules": {
"drowningdamage": {
"Value": true,
"Name": "drowningdamage"
},
"dotiledrops": {
"Value": true,
"Name": "dotiledrops"
},
"commandblockoutput": {
@NiclasOlofsson
NiclasOlofsson / gist:2a7933146f0e29474f87683b32c62847
Created March 29, 2017 17:28
Elytra extreme Player.OnTick code
public override void OnTick()
{
HungerManager.OnTick();
base.OnTick();
if (IsGliding)
{
if (CurrentSpeed > 30)
@NiclasOlofsson
NiclasOlofsson / CooldownTimer.cs
Created March 5, 2017 20:50
A cooldown timer for MiNET plugins.
using System;
namespace MiNET.GameFramework.Plugin.Utils
{
public class CooldownTimer
{
public TimeSpan TimeSpan { get; private set; }
public DateTime ClearingTime { get; private set; }
42 f1 ff ff ff 9f 34 06 00 01 10 32 56 00 ff ff Bñÿÿÿ?4....2V.ÿÿ
ff ff fe 01 80 02 02 00 00 00 00 00 00 00 00 00 ÿÿþ.?...........
00 00 00 00 00 00 00 00 00 00 83 d1 ba fa 0f 00 ..........?Ѻú..
83 d1 ba fa 0f 00 83 d1 ba fa 0f 83 d1 ba fa 0f ?Ѻú..?Ѻú.?Ѻú.
83 d1 ba fa 0f 83 d1 ba fa 0f 83 d1 ba fa 0f 83 ?Ѻú.?Ѻú.?Ѻú.?
d1 ba fa 0f 83 d1 ba fa 0f 83 d1 ba fa 0f 83 d1 Ѻú.?Ѻú.?Ѻú.?Ñ
ba fa 0f 83 d1 ba fa 0f 83 d1 ba fa 0f 83 d1 ba ºú.?Ѻú.?Ѻú.?Ѻ
fa 0f 83 d1 ba fa 0f 90 a1 c2 fc 0f dc 81 80 f8 ú.?Ѻú.¡Âü.܁?ø
0f 90 a1 c2 fc 0f 90 a1 c2 fc 0f 83 d1 ba fa 0f .¡Âü.¡Âü.?Ѻú.
90 a1 c2 fc 0f 90 a1 c2 fc 0f dc 81 80 f8 0f c3 ¡Âü.¡Âü.܁?ø.Ã
2016-11-12 13:48:08,026 DEBUG MiNET.Client.MiNetClient - > Receive: 14 (0x0e): McpeAddEntity
2016-11-12 13:48:08,026 DEBUG MiNET.Client.MiNetClient - McpeAddEntity Entity ID: -51539607504
2016-11-12 13:48:08,026 DEBUG MiNET.Client.MiNetClient - McpeAddEntity Runtime Entity ID: 56
2016-11-12 13:48:08,026 DEBUG MiNET.Client.MiNetClient - Entity Type: 2869 - 0xb35
2016-11-12 13:48:08,026 DEBUG MiNET.Client.MiNetClient - Entity Family: 11 - 0x0b
2016-11-12 13:48:08,026 DEBUG MiNET.Client.MiNetClient - Entity Type ID: 53 - 0x35 EnderDragon
2016-11-12 13:48:08,026 DEBUG MiNET.Client.MiNetClient - X: 57.99719
2016-11-12 13:48:08,026 DEBUG MiNET.Client.MiNetClient - Y: 4.06
2016-11-12 13:48:08,026 DEBUG MiNET.Client.MiNetClient - Z: 9.940071
2016-11-12 13:48:08,026 DEBUG MiNET.Client.MiNetClient - Yaw: 0
@NiclasOlofsson
NiclasOlofsson / helpcommand.js
Created October 29, 2016 16:56
FULL COMMAND /help EXAMPLE WITH VANILLA
{
"commandName": "help",
"commandOverload": "byPage",
"unkown1": 0,
"unkown2": 0,
"unkown4": false,
"unkown5": -1,
"commandJson": "null\n",
"unkown6": "null\n",
"unkown7": 0,
@NiclasOlofsson
NiclasOlofsson / Wither trace
Created October 18, 2016 15:38
Trace of wither fight, more or less complete, but missing parts ..
2016-10-16 22:51:18,592 DEBUG MiNET.Client.MiNetClient - > Receive: 14: McpeAddEntity (0x0e)
2016-10-16 22:51:18,592 DEBUG MiNET.Client.MiNetClient - McpeAddEntity Entity ID: 566935683067
2016-10-16 22:51:18,592 DEBUG MiNET.Client.MiNetClient - McpeAddEntity Runtime Entity ID: 5
2016-10-16 22:51:18,592 DEBUG MiNET.Client.MiNetClient - Entity Type: 68404
2016-10-16 22:51:18,592 DEBUG MiNET.Client.MiNetClient - X: 47.82257
2016-10-16 22:51:18,592 DEBUG MiNET.Client.MiNetClient - Y: 9.062544
2016-10-16 22:51:18,592 DEBUG MiNET.Client.MiNetClient - Z: 6.522105
2016-10-16 22:51:18,592 DEBUG MiNET.Client.MiNetClient - Yaw: 21.11277