PaperMC / PaperMC/Paper

Weighted pressure plates call interact events even if they are powered

Open
#5,146 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: bug version: 1.16
Dominant language
Java
Stars
12.7k
Forks
3.5k
Avg merge
3d 13h
Merged PRs (30d)
11

Description

What behaviour is expected:

Different kind of pressure plates produce the same events.

What behaviour is observed:

Binary pressure plates only call the Player/EntityInteractEvents when they get powered (activated). Weighted pressure plates continuously call these events, even if they are already powered (activated).

Steps/models to reproduce:
@EventHandler
private void on(EntityInteractEvent event) {
	Material material = event.getBlock().getType();
	if (Tag.PRESSURE_PLATES.isTagged(material)) {
		Bukkit.broadcastMessage(event.getEntity().getType() + " pressed " + material + " (cancelled: " + event.isCancelled() + ")");
	}
}

image
image

Plugin list:

Just mine, see code above.

Paper version:
[01:22:51 INFO]: This server is running Paper version git-Paper-"0514fc4e2" (MC: 1.16.5) (Implementing API version 1.16.5-R0.1-SNAPSHOT)
[01:22:51 INFO]: Previous version: git-Paper-"ca067dd6d" (MC: 1.16.5)
[01:22:51 INFO]: You are running the latest version
Anything else:

Pressure plates are just poorly implemented unfortunately, see #4962 as well. I plan on PRing fixes for these two issues if no one tells me not to.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named in the issue. Start by tracing weighted and binary pressure-plate interaction handling from the EntityInteractEvent reproduction, then compare when each plate emits events. Done means weighted plates emit interaction events only when they become powered, matching binary plates.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.