Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hey there, BlackAwps and I have been working on LuaCraft again, this time around it is a Forge mod.

 

Right now we support Minecraft 1.7.2 / Forge 10.12.1.1060, future versions should be easy to port.

 

Repo: https://bitbucket.org/luastoned/luacraft-forge

Download: http://luacraft.com/#download

We have our own forum at: http://forum.luacraft.com

 

width=800 height=467http://img.luastoned.com/luacraft_forge_v4.png[/img]

 

Here are some code samples to get everyone started.

 

High Jump, makes players jump quite high and take no fall damage.

function entityFall(ent, distance)
if (IsPlayer(ent)) then
	return true
end
end
hook.Add("entity.fall", "Fall!", entityFall)

function entityJump(ent)
local jumpVec = Vector(0, 0, 1.5)
if (IsPlayer(ent)) then
	ent:SetVelocity(jumpVec)
end
end
hook.Add("entity.jump", "Jump!", entityJump)

 

Biome name, your position and information about what you look at.

local font = surface.GetDefaultFont()

local matEye = Resource("silkicons:eye.png")
local matMap = Resource("silkicons:map.png")
local matTime = Resource("silkicons:time.png")
local matWorld = Resource("silkicons:world.png")

function _R.World:GetTimeString()
local worldTime = (self:GetTime() + 8000) % 24000
local hour = math.floor(worldTime / 1000)
local minute = math.floor((worldTime % 1000 / 1000) * 60) % 60

return string.format("%02d:%02d", hour, minute)
end

function extraInfo(time, phase)
local world = World()
local me = LocalPlayer()
local pos = me:GetPos()
local biome = world:GetBiome(pos)

surface.SetTexture(matWorld)
surface.DrawTexturedRect(2, 2, 8, 
font:DrawText(biome, 12, 2, true)

surface.SetTexture(matMap)
surface.DrawTexturedRect(2, 12, 8, 
font:DrawText(string.format("%d, %d", math.floor(pos.x), math.floor(pos.y)), 12, 12, true)

surface.SetTexture(matTime)
surface.DrawTexturedRect(2, 22, 8, 
font:DrawText(world:GetTimeString(), 12, 22, true)

local tr = me:GetEyeTrace()
if (tr.HitBlock) then
	surface.SetTexture(matEye)
	surface.DrawTexturedRect(2, 32, 8, 
	font:DrawText(tr.HitBlock:GetName(), 12, 32, true)
end
end
hook.Add("render.gameoverlay", "Extra Info", extraInfo)

 

3D rendering, because everyone loves that!

local vec1 = Vector(-190, 315, 72)
local vec2 = vec1 + Vector(0, 0, 1.2) 

local ang1 = Angle(0, 160, 0)

local lightGrey = Color(200, 200, 200, 255)
local lightBlue = Color(50, 50, 230, 255)

function gameRender(renderTime)
render.SetDrawColor(lightBlue)
render.DrawText("LuaCraft!", vec2, ang1, 1.25, true)

render.SetDrawColor(lightGrey)
render.DrawText("Forge modding with Lua", vec3, ang1, 0.5)
end
hook.Add("render.world", "3D Render", gameRender)

 

Have fun with this and feel free to post suggestions or whatever else is on your mind.

Happy coding!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.