Ozan uğur Çirci

When the player jumps, the entire world should rotate by 2 degrees each time they jump. The rotation should continue accumulating with every jump.

For example:

  • At 45° rotation, the player should start sliding because the world is tilted.
  • At 90° rotation, the player should fall toward the side.
  • At 180° rotation, the world should be completely upside down, causing the player to fall toward the ceiling.

This rotation should happen every time the player jumps, with each jump adding another 2 degrees to the world's rotation. The rotation should affect the entire world, including gravity and the player's movement, so that the player physically reacts to the changing orientation.

Kodari AI
KodariSep 27 at 6:10 pm 1
WorldTiltJumper
WorldTiltJumper is a Minecraft plugin that rotates the entire world by 2 degrees every time a player jumps. Each jump accumulates additional rotation, progressively tilting the world's orientation. At 45 degrees, players begin sliding due to the incline; at 90 degrees, they fall sideways; at 180 degrees, the world is upside down, causing players to fall toward the ceiling. The plugin applies continuous rotation to all entities, blocks, and gravity vectors, ensuring players physically react to the changing world orientation. It uses a Maven build system and integrates with Bukkit's physics engine to modify gravity direction and entity motion dynamically, creating a surreal, ever-shifting gameplay experience.
  1. Add a Maven Paper plugin with a jump listener and per-world accumulated rotation.

  2. Apply the resulting directional gravity to gravity-enabled entities, including players.

  3. Persist each world’s angle; note that Bukkit/Paper plugins cannot rotate block geometry, so this simulates gravity rather than physically rotating the world.

Created the Maven Paper plugin. Each jump adds 2° to that world’s saved rotation, and gravity-enabled entities—including players—receive acceleration along the resulting gravity direction.

Limitation: Paper’s plugin API cannot rotate block geometry or the world itself. This simulates the changing gravity and its effect on entity movement; blocks and collision surfaces remain in their normal orientation.

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
Code
3 152
src/main/java/com/kodari/worldtilt/WorldTiltPlugin.java
package com.kodari.worldtilt;

import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.entity.Entity;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.util.Vector;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.UUID;

public final class WorldTiltPlugin extends JavaPlugin implements Listener {
    private static final double GRAVITY_ACCELERATION = 0.08;
    private final Map<UUID, Double> rotations = new HashMap<>();
    private final Map<UUID, Boolean> originalGravity = new HashMap<>();
    private final Set<UUID> jumping = new HashSet<>();

    @Override
    public void onEnable() {
        loadRotations();
        getServer().getPluginManager().registerEvents(this, this);
        Bukkit.getScheduler().runTaskTimer(this, this::applyDirectionalGravity, 1L, 1L);
    }

    @EventHandler
    public void onPlayerMove(PlayerMoveEvent event) {
        if (event.getTo() == null) {
            return;
        }

        UUID playerId = event.getPlayer().getUniqueId();
        if (event.getPlayer().isOnGround()) {
            jumping.remove(playerId);
            return;
        }

        if (event.getTo().getY() > event.getFrom().getY() && jumping.add(playerId)) {
            UUID worldId = event.getPlayer().getWorld().getUID();
            rotations.merge(worldId, 2.0, Double::sum);
        }
    }

    @EventHandler
    public void onPlayerQuit(PlayerQuitEvent event) {
        jumping.remove(event.getPlayer().getUniqueId());
    }

    private void applyDirectionalGravity() {
        for (World world : Bukkit.getWorlds()) {
            double angle = Math.toRadians(rotations.getOrDefault(world.getUID(), 0.0));
            Vector gravity = new Vector(Math.sin(angle), -Math.cos(angle), 0)
                    .multiply(GRAVITY_ACCELERATION);

            for (Entity entity : world.getEntities()) {
                UUID entityId = entity.getUniqueId();
                originalGravity.putIfAbsent(entityId, entity.hasGravity());
                if (!Boolean.TRUE.equals(originalGravity.get(entityId))) {
                    continue;
                }

                if (entity.hasGravity()) {
                    entity.setGravity(false);
                }
                entity.setVelocity(entity.getVelocity().add(gravity));
            }
        }
    }

    private void loadRotations() {
        var section = getConfig().getConfigurationSection("rotations");
        if (section == null) {
            return;
        }

        for (String key : section.getKeys(false)) {
            try {
                rotations.put(UUID.fromString(key), section.getDouble(key));
            } catch (IllegalArgumentException ignored) {
                getLogger().warning("Ignoring invalid world UUID in saved rotations: " + key);
            }
        }
    }

    @Override
    public void onDisable() {
        for (World world : Bukkit.getWorlds()) {
            for (Entity entity : world.getEntities()) {
                if (Boolean.TRUE.equals(originalGravity.get(entity.getUniqueId()))) {
                    entity.setGravity(true);
                }
            }
        }

        getConfig().set("rotations", null);
        rotations.forEach((worldId, angle) -> getConfig().set("rotations." + worldId, angle));
        saveConfig();
    }
}